Algorithms and machine learning
In normal programming a person writes the rules. In machine learning the computer finds the rules itself from examples.
📌 Key points
- An algorithm is a precise, step-by-step set of instructions for solving a problem or doing a task.
- In traditional programming a programmer writes the rules: input + rules → output.
- In machine learning (ML) the computer is given examples (data, often with the right answers) and finds the rules itself: data + answers → rules.
- The result of machine learning is a model: a program that makes predictions or decisions about new inputs.
- Rule-based programs are predictable and easy to explain, but some rules are too hard to write by hand, such as how to recognise handwriting.
- ML works well when there are many examples but the rules are too complex to write. It needs lots of good data, can still make mistakes and can be hard to explain.
- ML still uses algorithms: a learning algorithm builds the model from the data.
- AI is the big field. Machine learning is one part of AI, and deep learning is one part of machine learning.
📖 Key words
- Algorithm
- A precise, step-by-step set of instructions for solving a problem.
- Rule-based system
- A program that follows rules written by a person, e.g. "if temperature < 20 °C, turn the heating on".
- Machine learning
- A type of AI where computers learn patterns from data instead of being given every rule.
- Model
- The program produced by machine learning. It uses what it learned to make predictions.
- Prediction
- A model's output for a new input, e.g. "this email is spam".
- Deep learning
- Machine learning with neural networks that have many layers.
✏️ Worked example
How could a computer decide which emails are spam?
- Rule-based way: a programmer writes rules such as "if the email says WIN MONEY, mark it as spam".
- Problem: spammers just change the words, so the programmer must keep writing new rules.
- Machine learning way: give a learning algorithm thousands of emails, each labelled "spam" or "not spam".
- The algorithm finds patterns in the words, links and senders, and builds a model that predicts how likely a new email is to be spam.
- When users mark new emails as spam, the model can be trained again, so it keeps up with new tricks.
Remember: traditional programming is "rules in, answers out". Machine learning is "examples in, rules out".
Test yourself8 questions from a bank of 18. A new mix every time.
Start the quiz →