The three flavors of learning
Supervised, unsupervised, and reinforcement learning — what separates them and which real problems belong to each.
The question that decides everything: do you have answers?
Every machine learning problem starts with the same question — when you're teaching the computer, do you already know the correct answer for each example, or not?
That single question splits the entire field into three families.
1. Supervised learning — learning with an answer key
This is "here are 10,000 emails, and here is a label on each one saying spam or not span." You have inputs (the email) and you have the correct output (the label) for every single example. The algorithm's job is to find the pattern that connects one to the other, so it can label a brand-new email it's never seen.
It's called supervised because it's like a student doing practice problems from a textbook that has the answers printed in the back. You check your work against the answer key every single time.
Supervised learning itself splits into two shapes, based on what kind of answer you're predicting:
- Regression — the answer is a number. Predicting a house price (21.4°C$), or someone's age from a photo.
- Classification — the answer is a category. Spam or not spam. Cat, dog, or neither. Which of five diseases, if any.
Someone shows you ten fruits and tells you the name of each one. Next time you're handed a fruit without being told its name, you already know — because you've seen enough examples with the answer attached.
2. Unsupervised learning — learning without an answer key
Now imagine you're handed 10,000 emails with no labels at all. Nobody tells you which are spam. All you can do is look for structure — emails that resemble each other, natural groupings, patterns that stand out.
This is unsupervised learning: finding structure in data when nobody hands you the "correct" answer.
Two common jobs here:
- Clustering — group similar things together. A store might cluster its customers into "bargain hunters," "loyal regulars," and "one-time buyers" purely from purchase patterns, without ever being told those categories exist.
- Dimensionality reduction — you have data described by hundreds of numbers per example, and you want to squash it down to the handful of numbers that actually matter, throwing away the noise.
Nobody tells you which toys are "cars" and which are "animals," but if you dump a toy box on the floor, you'll naturally start sorting them into piles because the cars just look like each other, and so do the animals. Nobody labeled them — you found the grouping yourself.
3. Reinforcement learning — learning from consequences
Here there isn't even a fixed dataset to look at. Instead, an agent takes actions inside an environment, and gets a reward or penalty based on what happens. It learns, by trial and error over huge numbers of attempts, which actions tend to lead to good outcomes.
This is how a computer learns to play chess, or how a robot learns to walk: it doesn't get told the "right move" for each board position — it plays, sometimes wins and sometimes loses, and slowly develops a sense for what tends to work.
A puppy doesn't have a labeled dataset of "good behaviors." It sits, and if a treat shows up, sitting starts to feel like a good idea. It jumps on the couch, gets told off, and jumping starts to feel like a bad idea. Nobody gave it an answer key — the consequences taught it.
Putting them side by side
| Do you have labels? | Goal | Example | |
|---|---|---|---|
| Supervised | Yes, for every example | Predict an output for new inputs | Spam filter, house price prediction |
| Unsupervised | No | Find hidden structure | Customer segmentation |
| Reinforcement | No, but you get feedback (reward) | Learn a strategy | Game-playing AI, robotics |
Why this course is mostly about supervised learning first
Supervised learning is where almost every core idea in this course gets introduced — loss functions, gradient descent, overfitting, evaluation — because it's the easiest setting to be precise in: you always know exactly how wrong a guess was, because you have the right answer sitting right there to compare against. Once those ideas are solid, unsupervised methods (later in this course) turn out to reuse most of the same math, just without an answer key to check against.
Reinforcement learning is a large enough subject that it deserves its own course entirely, so this one only touches it lightly. The next lesson goes back into supervised learning and shows the actual mechanical loop a model uses to learn from data.