Supervised, Unsupervised, and Reinforcement Learning
The three families of machine learning differ by the teaching signal: a correct label, raw structure, or a reward after actions.
Explain like I'm new to AI
Machine learning is “learn from data instead of writing rules.” That sentence hides a fork: what kind of feedback does the data give?
- Supervised — each example already has the answer. Email + “spam.” House + sold price. You are learning a mapping you can reuse on new inputs.
- Unsupervised — examples have no answer column. A pile of shoppers, or tickets, or pixels. You are looking for structure: groups, compressions, oddballs.
- Reinforcement learning (RL) — nobody labeled the right move. An agent acts in an environment and gets a reward (win the game, the robot didn’t drop the mug). It learns a policy: what to do in which situation.
What is the teaching signal? Click one:
Labeled pairs: input → correct output
Each house has a known price. Each email is already spam or ham.
A mapping. After training it can label new, unseen inputs.
Example: Hours studied → exam score. Photo → “cat”. Ticket text → “refund”.
Deep learning is not a fourth family. It is a style of model (stacked neural nets) you can use inside any of the three. A neural net that predicts house prices is still supervised. A clustering method can be classical or deep. RL can use a neural net as the policy.
Mental model
Three teachers:
- Supervised is a marked exam. Every practice question has the answer key in the margin.
- Unsupervised is a box of unlabeled photos. Sort them into piles that look related. Nobody told you the pile names.
- RL is learning to ride a bike. You are not shown a labeled dataset of “correct lean angles.” You wobble, fall, get a delayed “you stayed up,” and adjust.
If you remember only one distinction: did a human (or a system of record) already write the target for each row? Yes → supervised. No, and you want groups or compression → unsupervised. No, and the feedback is a score after a sequence of actions → RL.
How it works
Supervised
- Collect pairs
(x, y)— features and a target. - If
yis a number, you are heading toward regression. Ifyis a category, classification. - Train: predict
ŷ, measure error vsy, adjust the model. - Evaluate on rows the model never trained on. That split is what later lessons on overfitting and cross-validation are for.
Unsupervised
- Collect
xonly. - Choose a notion of structure: distance (clusters), reconstruction (compression), density (anomalies).
- There is no
yto score against in the supervised sense. You judge clusters by usefulness, stability, or a downstream task.
Reinforcement
- Define states, actions, and a reward.
- The agent tries, observes the next state and reward, and updates a policy (or a value function that scores states).
- Credit assignment is hard: the winning move may have been twenty steps ago. That is why RL is powerful and sample-hungry.
Real-world example
A support org has three different ML jobs on the same tickets:
- Supervised: tag “billing / bug / how-to” because agents already labeled last year’s queue. Train a classifier.
- Unsupervised: you have no tags yet. Cluster embeddings of tickets to discover that “SSO timeout” is a hidden theme. A human then names the cluster.
- RL (rare on this desk): an agent that chooses which knowledge article to show, scored by “did the user stop writing?” — delayed, noisy reward. Most teams should not start here.
A game studio trains an RL policy to play a title. A bank trains supervised models on historical defaults. Same word “training”; different signal.
Technical explanation
Formally:
- Supervised: estimate
p(y | x)orE[y | x]from i.i.d. labeled samples. - Unsupervised: estimate structure in
p(x)— mixture components, a low-dimensional manifold, outliers in the tails. - RL: maximize expected discounted reward
E[Σ γ^t r_t]by interacting with a Markov decision process. Data is on-policy unless you deliberately reuse old trajectories.
Cousins you will meet later, still not extra families:
- Self-supervised (masked language modeling, contrastive vision) invents a pretext label from the data itself. It is unsupervised in spirit, supervised in the training loop. Foundation models use it, then you fine-tune with real labels.
- Semi-supervised mixes a few labels with a lot of unlabeled
x. - Imitation / offline RL blurs into supervised learning when you just clone expert actions.
| Supervised | Unsupervised | |
|---|---|---|
| Need y? | Yes — a target per row | No — x only |
| Question | What should this input map to? | What structure is in this pile? |
| Score | Error vs the label (MSE, F1…) | Usefulness, silhouette, downstream task |
| Classic next lesson | Regression, then classification | Clustering |
RL sits beside that table, not on it: the unit of data is a trajectory, not a row with a static y.
Common mistakes
Calling every unlabeled project “unsupervised learning” when you actually have a target you have not extracted yet. Ticket type lives in the CRM. Pull it — that is supervised data you are ignoring.
- Treating clustering output as if it were a certified class label. Clusters are hypotheses. Classification requires names you already trust.
- Reaching for RL because it sounds advanced. If you can write
(x, y)pairs, use supervised learning. RL is for sequential decisions with delayed reward, not “we don’t feel like labeling.” - Confusing deep learning with a learning paradigm. Depth is the model; the paradigm is the signal.
When to use it
- Supervised when history already recorded the thing you want to predict, and new cases will look like old ones.
- Unsupervised for exploration, segmentation, anomaly hints, or compressing
xbefore a later supervised step. - RL when the system must act over time and you can define a reward you are willing to optimize (games, robotics, some bidding and control).
When NOT to use it
- Do not pick RL as a first production tool for a spreadsheet problem. Label or extract
y. - Do not run unsupervised clustering and then ship the cluster id as “fraud” without a labeled holdout. That is a story, not a detector.
- Do not force supervised learning when there is no stable target (the business has not decided what “good” means). Fix the definition first.
Alternatives
- Rules and heuristics when the mapping is short and legal (“if amount > 10k and country in list → review”).
- Retrieval and tools (later AI stack) when the “answer” is a document, not a learned function of columns.
- Human labeling so an unsupervised pile becomes a supervised dataset.
Quick quiz
Related concepts
- What is Machine Learning? — Machine learning is AI that learns patterns from data instead of being explicitly programmed with rules.
- What is Regression? — Regression predicts a number from features — a line, a curve, or a tree — scored by how far predictions miss, usually with MSE.
- What is Classification? — Classification assigns a discrete label — spam or not, cat or dog — by learning a decision boundary from labeled examples.
- What is Clustering? — Clustering groups unlabeled examples by similarity. k-means is the starter method; k is a choice, and clusters are not classes.
- What is Deep Learning? — Deep learning is machine learning using many-layered neural networks that learn features automatically.
Last reviewed: 2026-09-04 · Written by ByHeart AI · Reviewed by ByHeart AI