Classical machine learning
Types of learning
Supervised learning has labels, unsupervised learning has inputs only, self-supervised learning builds labels from the data, and reinforcement learning learns from rewards. The feedback you have decides which one fits.
Before you pick a model, check what kind of feedback you actually have. Labels tell the model the right answer for each example. Without labels, a model can still find structure in the inputs. Given rewards for a sequence of actions, a model can learn a policy for choosing actions. Those are the main families, and the data you can get decides which one applies.
The big idea
- Supervised learning. Every example comes with a label. If the label is a number, the task is regression. If the label is a category, the task is classification.
- Unsupervised learning. Only inputs. The model finds clusters, principal components or anomalies.
- Self-supervised learning. The labels come from the data itself. Predict the next token, or fill in a masked word. Large language models are trained this way.
- Reinforcement learning (RL). A policy picks actions and receives rewards, sometimes many steps later. The goal is the highest total reward over time.
An analogy: supervised learning is a student with an answer key. Unsupervised learning is sorting a pile of photos into groups without anyone naming them. Reinforcement learning is training a dog with treats after a sequence of tricks. Self-supervised learning looks like supervised learning, but nobody wrote the answers. The text already contains them.
Walking through a decision
Start with the question "do I have labels?". Then ask whether the target is a number or a category. Only reach for RL when the problem is a sequence of actions with a reward signal.
| Problem | Family | Why |
|---|---|---|
| Predict tomorrow's demand | Supervised regression | Past demand gives the labels. |
| Flag spam email | Supervised classification | Past emails are labeled spam or not. |
| Group users by behavior | Unsupervised | No labels exist. |
| Train a base language model | Self-supervised | The next token is the label. |
| Tune a chatbot from ratings | Reinforcement learning | Reward arrives after whole responses. |
Common mistakes
- Treating self-supervised as unsupervised. It trains with a prediction loss against the data itself, and it is often the main training signal in large models.
- Reaching for RL by default. RL needs a reward signal and a way to try actions. A classifier trained on logged outcomes is often enough.
- Choosing the family before checking the labels. Labels that are delayed, noisy or missing change the plan.
Check yourself
- A spam filter is trained on emails marked spam or not spam. Answer: Supervised classification.
- A model learns to predict the next word of web text. Answer: Self-supervised. The next word is the label, so no human has to annotate anything.
Key takeaways
- Supervised learning needs labels, and regression and classification differ by the target type.
- Unsupervised learning finds structure in inputs without labels.
- Self-supervised learning creates labels from the data, which is how large language models learn.
- Reinforcement learning needs rewards for sequences of actions.
Further learning
The framing question comes next: framing a business problem.
Related
Framing ML problems
Learning types, business framing, data splits, baselines and when not to use ML at all.
Unsupervised learning
Clustering, dimensionality reduction and anomaly detection without labels.
Reinforcement learning basics
MDPs, returns, policy gradients, advantages and PPO. The minimum RL needed to read modern LLM post-training papers. Start here for the map.