- Describe how supervised machine learning works
- Explain training data, features and labels
- Explain why a model is tested on unseen data
- Identify overfitting
You know that an algorithm follows rules. In machine learning, a program finds patterns from data instead of following only hand-written rules.
Learning from examples
Machine learning builds a model that finds patterns in data. In supervised learning, the training data contains examples with correct answers. A spam filter, for example, studies emails labelled spam or not spam. The model adjusts its internal values to reduce its errors, then uses the patterns it learned to make predictions.
A measurable input used by a model, such as the number of links in an email.
The correct output in a training example.
Training and testing
We split data into a training set and a test set. The model learns from the training set. The test set is kept aside so that we can measure how well the model handles new data. Training accuracy alone can be misleading.
When a model learns details of the training data so closely that it performs poorly on new data.
A model scores 99% on training data but only 62% on test data. What does this suggest?
It works very well on known examples.
It works much less well on new examples.
Answer: The model has probably overfitted, so it has not generalised well.
A model learns from the data it receives. Biased or unrepresentative data can produce unfair predictions.
Practice
Quick check
What does a model learn from?
What is overfitting?
What might biased training data cause?
- Machine learning finds patterns in data.
- Supervised learning uses features and labels.
- Test data shows whether a model generalises.
- Biased data can lead to unfair results.
