Supervised
Every example carries the right answer. Photographs labelled "malaria" or "clear", emails labelled "spam". Most commercial AI is supervised, and the labelling is usually the expensive part.
Training data, features, loss, and the loop that turns a pile of examples into a prediction.
Strip away the vocabulary and machine learning is a loop with three steps, repeated until the answers stop improving.
Run that a few million times and the numbers settle somewhere useful. There is no moment of insight — only a very patient descent down a slope.
Suppose you want to predict maize yield in tonnes per hectare from seasonal rainfall in millimetres. Five seasons of records, and a model with exactly one number in it.
| Season rainfall (mm) | 320 | 480 | 610 | 750 | 880 |
|---|---|---|---|---|---|
| Recorded yield (t/ha) | 1.4 | 2.1 | 2.9 | 3.2 | 4.1 |
The model is yield = weight × rainfall. Training means finding the weight that
makes the predictions closest to what actually happened. Here are four candidate weights and the
average squared error each produces — that error is the loss.
| Candidate weight | Predictions (t/ha) | Loss | How wrong |
|---|---|---|---|
| 0.0020 | 0.6, 1.0, 1.2, 1.5, 1.8 | 2.613 | |
| 0.0035 | 1.1, 1.7, 2.1, 2.6, 3.1 | 0.442 | |
| 0.0045 | 1.4, 2.2, 2.7, 3.4, 4.0 | 0.016 | |
| 0.0055 | 1.8, 2.6, 3.4, 4.1, 4.8 | 0.406 |
A real model has billions of weights instead of one, and it works out which direction to move them by calculus rather than by trying four values. Nothing else about the loop changes.
Which one applies depends entirely on what your data looks like.
Every example carries the right answer. Photographs labelled "malaria" or "clear", emails labelled "spam". Most commercial AI is supervised, and the labelling is usually the expensive part.
No labels. The model looks for structure — customers who behave alike, transactions that do not fit the usual pattern. Useful when nobody knows what the categories should be.
The model acts, receives a reward or a penalty, and adjusts. How game-playing systems and robots are trained, and part of how chat models are tuned to be useful rather than merely fluent.
Overfitting is a model that memorised its training examples instead of learning the pattern behind them. It scores beautifully on data it has seen and badly on anything new — the student who learned the past papers rather than the subject.
The defence is to hold data back. Split your examples into a training set and a test set the model never sees during training, then judge it only on the test set. A team that reports accuracy without saying how they split the data has told you nothing.