Supervised, Unsupervised, Reinforcement
What separates the three is not the algorithm but the shape of the feedback available. One question, and its answer decides everything else.
What you will be able to do
- Tell the three kinds of learning apart by the shape of the data
- Pick the right kind for a real problem
- Spot a problem that looks supervised and is not
One question separates the three kinds of learning, and it is not about algorithms: what shape of feedback do you have?
| Kind | The feedback | The question it answers |
|---|---|---|
| Supervised | A correct answer for every example | "What is this?" / "How much?" |
| Unsupervised | No answers at all | "What structure is in here?" |
| Reinforcement | A score, after a series of actions | "What action should I take?" |
Supervised: there is an answer key#
You have labelled data. A thousand emails already marked spam or not. Five thousand houses with their sale prices. The model learns the mapping from input to that label.
It comes in two forms, and the only difference is the kind of label:
| Classification | Regression | |
|---|---|---|
| The label is | A category | A number |
| Example | spam / not spam | house price |
| Model output | A class, or a probability per class | A single number |
| Measured with | Accuracy, precision, recall, F1 | RMSE, MAE, R² |
You have 5,000 houses with their sale prices and want to predict the price of a new one. What kind of problem is this?
Unsupervised: there is no answer key#
You have 50,000 customers and no labels of any kind. Nobody can tell you which segment is "right", because the segments do not exist until you create them.
Reinforcement: the feedback is late and incomplete#
An agent acts, the environment rewards or punishes, the agent learns. What separates it from supervised learning is not the reward but the delay: a bad chess move is only felt twenty moves later, and nothing tells you which move was the bad one.
The trap: problems that look supervised#
This comes up constantly in real work. "We have historical data, so it is supervised" — not necessarily. The question is whether the label you have actually answers the question you are asking.
| What you want to know | The label you have | The problem |
|---|---|---|
| Which customers will churn | Who already churned | Fine — if "churned" is consistently defined |
| Which loans will default | Approved loans that defaulted | Selection bias: rejections have no label |
| Which ads will be clicked | Ads shown and clicked | Selection bias: never-shown ads have no data |
| The optimal price | Prices set, and what sold | Not supervised — this is a causal question |
The last row goes wrong most often. Predicting sales from prices that were set tells you only what happened at those prices — not what would happen at a price never tried. That is a causal question, and ordinary machine learning does not answer it.
You are asked to detect machines about to fail. You have 2 years of sensor data but only 7 recorded failures. What kind of problem is this?