Key AI Techniques
Three Ways Machines Learn: Supervised, Unsupervised, and Reinforcement Learning
6 min read
Not all learning is the same
In the previous lesson, the real estate model learned by studying thousands of past sales — each one labeled with a correct price. That's one approach.
But what if you don't have any labels? What if the problem isn't about predicting a fixed answer, but about learning the best action to take in a changing environment?
Machine learning has three fundamentally different answers to these situations. Understanding them is one of the clearest ways to see how AI actually gets built.
1. Supervised learning: learning with an answer key
Supervised learning is the most common approach. You provide a dataset where every example comes with a correct answer — a label. The model learns to map inputs to outputs by studying those labeled examples.
The word "supervised" refers to the fact that a human (or a labeling process) has already decided what the right answer is for each example.
Two flavors: classification and regression
Classification — the answer is a category:
- Is this email spam or not spam?
- Does this photo contain a dog?
- Is this transaction fraudulent?
The model learns to sort inputs into discrete buckets.
Regression — the answer is a number:
- What will this house sell for?
- How many units will we sell next quarter?
- What will this patient's blood pressure be in six months?
The model learns to output a continuous value.
When to use supervised learning
- You have labeled training data (or can afford to create it)
- You have a clearly defined target to predict
- Accuracy on a specific task is the priority
The trade-off
Creating labeled data takes time and money. Labeling medical images or legal documents — which require expert reviewers — can cost millions of dollars. The better the labels, the better the model, but there's always a cost.
2. Unsupervised learning: finding patterns without answers
Unsupervised learning removes the answer key entirely. You give the model raw, unlabeled data and ask it to find structure on its own.
The most common technique is clustering: grouping similar examples together based on their features, without any human having defined what the groups should be.
Example: customer segmentation
A supermarket has purchase data for 500,000 customers. Nobody has labeled these customers as "bargain hunter," "health-conscious buyer," or "bulk shopper." An unsupervised model scans the data and discovers natural groupings — clusters of customers who consistently buy similar things. The business then names those clusters and tailors campaigns to each.
Example: property types
A real estate platform wants to understand which kinds of properties are popular in different cities. Rather than predefining categories, an unsupervised model finds them — surfacing a natural cluster of high-priced, large, school-adjacent listings that a human later labels "family homes."
When to use unsupervised learning
- You don't know what categories exist yet and want to explore
- Labeling is impractical due to cost or scale
- The goal is pattern discovery, not a specific prediction
The trade-off
Without labels, you lose precision. Unsupervised models excel at exploration and discovery, but they can't be directly optimized toward a specific prediction target.
3. Reinforcement learning: learning through trial and error
Reinforcement learning (RL) is a completely different philosophy. Instead of learning from a fixed dataset, the model — called an agent — learns by interacting with an environment, receiving rewards for good actions and penalties for bad ones.
There's no correct answer to copy. There's only: did this action lead to a better outcome?
The core loop
- The agent observes its current state
- It takes an action
- The environment returns a reward (positive or negative)
- The agent updates its strategy to maximize long-term reward
- Repeat — millions of times
This is exactly how you train a dog: reward good behavior, discourage bad behavior, repeat until reliable. Except the model can run this loop millions of times per hour.
Example: video recommendations
A streaming platform's recommendation engine observes what a user has watched, recommends the next video, then observes whether the user watched it fully (positive reward), skipped it after 10 seconds (small penalty), or turned off the app (large penalty). Over time, the model learns which recommendations lead to sustained watching — the outcome the platform cares about.
Example: robotics
A robot arm learning to pick up objects starts by moving randomly. It occasionally manages to grip something — that earns a reward. Over millions of simulated attempts, it learns which joint positions and grip pressures lead to successful picks. No human programmed the gripping strategy; the robot discovered it through trial and error.
When to use reinforcement learning
- The problem involves a sequence of decisions, not a single prediction
- There's a clear reward signal (watch time, score, task completion)
- The environment allows for repeated experimentation (simulation or controlled setting)
The trade-off
RL is more complex to set up. You need a reward function, an environment to interact with, and often a simulator. It can also be brittle — a model trained in simulation may behave unexpectedly in the real world.
Comparison at a glance
| Aspect | Supervised | Unsupervised | Reinforcement |
|---|---|---|---|
| Needs labels? | Yes | No | No (needs rewards) |
| Output | Predictions | Clusters / patterns | Actions / decisions |
| Main technique | Classification, regression | Clustering | Trial and error |
| Example | Spam filter, price predictor | Customer segments | Game-playing AI, robotics |
| Main challenge | Labeling cost | Less precise output | Complex setup |
Key takeaway
Supervised learning uses labeled data to learn specific prediction tasks. Unsupervised learning discovers hidden structure in data without labels. Reinforcement learning trains agents to make decisions by rewarding good outcomes and penalizing bad ones. Most real-world AI systems use one or more of these approaches, chosen based on what data is available and what problem needs to be solved.
What's next?
These three learning paradigms describe how a model is trained. Deep learning is the neural network architecture that makes all three dramatically more powerful for complex, unstructured data. That's what we'll cover next.