Skip to content
Getting Started16 min read

Supervised, Unsupervised, Reinforcement

Free lessoninteractive

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?

KindThe feedbackThe question it answers
SupervisedA correct answer for every example"What is this?" / "How much?"
UnsupervisedNo answers at all"What structure is in here?"
ReinforcementA 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:

ClassificationRegression
The label isA categoryA number
Examplespam / not spamhouse price
Model outputA class, or a probability per classA single number
Measured withAccuracy, precision, recall, F1RMSE, MAE, R²
Checkpoint

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.

Loading simulation…

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 knowThe label you haveThe problem
Which customers will churnWho already churnedFine — if "churned" is consistently defined
Which loans will defaultApproved loans that defaultedSelection bias: rejections have no label
Which ads will be clickedAds shown and clickedSelection bias: never-shown ads have no data
The optimal pricePrices set, and what soldNot 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.

Checkpoint

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?