Choosing a Learning Type
You have now met eight ways a machine can learn. They are not competing products: they answer different questions about your data. Three questions decide most cases: What feedback do you have? (labels, some labels, no labels, rewards) How does the data arrive? (all at once or as a stream) What does a label cost?
The eight types side by side
| Type | Feedback during training | Typical question | Example |
|---|---|---|---|
| Supervised | a label for every example | predict from | house prices, spam filtering |
| Unsupervised | none | what structure is in the data? | customer segments, anomalies |
| Semi-supervised | labels for a few, many unlabelled | use unlabelled data to label better | medical images with few expert labels |
| Self-supervised | targets made from the data itself | learn general representations | pretraining language and vision models |
| Reinforcement | rewards for actions | which actions maximise long-term reward? | games, robots, RLHF |
| Online | any of the above, arriving as a stream | keep the model current | fraud, recommendation |
| Batch | any of the above, as a fixed snapshot | train once, deploy, retrain on schedule | credit scoring, most production models |
| Active | labels on request, from a human | which examples are worth labelling? | expensive expert annotation |
The first five describe what kind of feedback the model learns from. Online and batch describe how training is scheduled, and active learning describes how labels are acquired. So they combine: a supervised model trained in batch mode; an online reinforcement learner; active learning that feeds a supervised model; self-supervised pretraining followed by supervised fine-tuning.
A decision guide in code
The function below encodes the questions as a small rule-based helper. It is deliberately simple; real projects weigh more factors, but the order of the questions is right.
def suggest(labels, reward_signal=False, data_arrives="all at once", labelling_cost="low", structure_in_raw_data=False):
if reward_signal:
return "reinforcement learning"
if labels == "none":
return "self-supervised pretraining" if structure_in_raw_data else "unsupervised learning"
if labels == "few":
if labelling_cost == "high":
return "active learning (ask an expert about the most useful rows)"
return "semi-supervised learning"
mode = "online learning" if data_arrives == "stream" else "batch learning"
return f"supervised learning, trained by {mode}"
cases = {
"house prices with sale records": dict(labels="all"),
"group shoppers, no labels": dict(labels="none"),
"robot learning to walk": dict(labels="none", reward_signal=True),
"X-rays, radiologist time is scarce": dict(labels="few", labelling_cost="high"),
"click prediction, events every second": dict(labels="all", data_arrives="stream"),
"billions of unlabelled sentences": dict(labels="none", structure_in_raw_data=True),
}
for task, answers in cases.items():
print(f"{task:38} -> {suggest(**answers)}")house prices with sale records -> supervised learning, trained by batch learning
group shoppers, no labels -> unsupervised learning
robot learning to walk -> reinforcement learning
X-rays, radiologist time is scarce -> active learning (ask an expert about the most useful rows)
click prediction, events every second -> supervised learning, trained by online learning
billions of unlabelled sentences -> self-supervised pretraining
Notice that this helper is itself traditional programming: if-then rules written by a person, the right tool because the logic is known and small.
Questions to ask, in order
- Is there a reward for actions rather than a correct answer? Reinforcement learning, ideally in a simulator. If you have recordings of experts acting, imitation (supervised) learning may be simpler.
- Do you have labels?
- Enough labels: supervised. This is the first choice whenever it is possible; it is the most reliable and the easiest to evaluate.
- A few, plus much unlabelled data from the same source: semi-supervised, and/or active learning if more labels can be bought.
- None, and you want structure (groups, anomalies, compression): unsupervised.
- None, but huge amounts of raw text, images or audio: self-supervised pretraining, or reuse a model someone else pretrained.
- How does data arrive, and how fast does it change? A fixed snapshot and slow change: batch, retrained on a schedule. A fast stream or fast drift: online updates, or frequent batch retraining.
- Can you afford to evaluate it? Whatever you choose, you need some labelled data for a test set. A method you cannot evaluate is a method you cannot trust.
Pitfalls
- Choosing by fashion. RL and self-supervised learning are exciting, but most business problems with labels are best served by plain supervised learning.
- Forgetting that types combine. "Supervised or online?" is not a real choice; online describes how a supervised model is trained.
- Skipping the label question. Many projects stall because nobody planned where labels come from. Decide early whether you will record outcomes, annotate, or buy labels.
Practice
- A warehouse wants to detect damaged parcels from camera images. It has 2 million unlabelled images and budget for 2000 human labels. Suggest a combination of learning types.
Answer
Start from a model pretrained with self-supervision (on general images, or on the 2 million warehouse images themselves). Use active learning to choose which 2000 images to label, mixing in a random sample for a fair test set. Fine-tune with supervised learning on the labels, optionally adding pseudo-labels from semi-supervised learning. Train in batch mode and retrain when monitoring shows drift (new packaging, new cameras).
- Which learning type describes a model that groups news articles into topics nobody defined in advance, and then is updated every hour as new articles arrive?
Answer
Unsupervised learning (clustering into topics), trained online (incremental updates every hour).
Test yourself
Which pair describes how training is scheduled rather than what feedback is used?
- Supervised and unsupervised
- Online and batch
- Semi- and self-supervised
- Reinforcement and active
You have 50,000 loan applications with known outcomes, and new data arrives monthly. What is the most natural starting point?
- Reinforcement learning
- Supervised learning, trained in batch mode and retrained regularly
- Unsupervised clustering
- Self-supervised pretraining
Why is some labelled data needed even for unsupervised or self-supervised projects?
- The algorithms crash without labels
- To evaluate whether the result is useful
- To speed up training
- It is not needed