Core Concepts
The three types of machine learning — supervised, unsupervised, and reinforcement learning. Key terminology and when each type applies.
Premium Course Content
This lesson is part of a premium course. Upgrade to Pro to unlock all premium courses and content.
- Access all premium courses
- 1000+ AI skill templates included
- New content added weekly
Three Ways Machines Learn
Machine learning sounds like one thing, but it’s actually three fundamentally different approaches. Each one solves a different type of problem, and knowing which to apply is one of the most important skills in ML.
Supervised Learning: Learning From Examples
How it works: You give the algorithm labeled data — inputs paired with correct outputs. The algorithm learns the pattern connecting inputs to outputs, then predicts outputs for new inputs.
Analogy: A teacher shows a student 1,000 photos of dogs and cats, each labeled. After enough examples, the student can identify new animals they’ve never seen. The labels are the “supervision.”
Two main tasks:
| Task | What It Predicts | Example |
|---|---|---|
| Classification | A category (discrete) | Email → spam or not spam |
| Regression | A number (continuous) | House features → sale price |
Classification predicts which category something belongs to. Is this email spam? Is this tumor malignant or benign? Will this customer churn? The output is a label — one of a predefined set of options.
Regression predicts a numerical value. What will this house sell for? How many units will we sell next quarter? What’s the expected temperature tomorrow? The output is a number on a continuous scale.
Supervised learning dominates real-world ML. Most business problems — prediction, classification, forecasting — are supervised learning tasks. If you have historical data with known outcomes, supervised learning applies.
✅ Quick Check: A real estate company wants to predict house prices based on square footage, bedrooms, location, and age. Is this classification or regression? Regression — because the output is a continuous number (price), not a category. The model learns the relationship between features (square footage, bedrooms, location, age) and the target variable (price). If the question were “will this house sell above or below $500K?” — that would be classification (two categories: above or below).
Unsupervised Learning: Finding Hidden Patterns
How it works: You give the algorithm data with no labels. No correct answers. The algorithm finds structure, patterns, and groupings on its own.
Analogy: You dump 10,000 photos on a table with no labels. You ask someone to organize them. They might group by subject (people, landscapes, food), by color palette, by time of day, or by some other pattern they notice. Nobody told them what groups to make — they discovered the structure.
Two main tasks:
| Task | What It Does | Example |
|---|---|---|
| Clustering | Groups similar data points | Customer segmentation |
| Dimensionality reduction | Simplifies complex data while preserving patterns | Visualizing high-dimensional data |
Clustering finds natural groups. Feed customer purchase data to a clustering algorithm, and it might discover segments like “high-value frequent buyers,” “seasonal shoppers,” “discount-only buyers,” and “one-time purchasers.” Nobody defined these groups — the algorithm found them.
Dimensionality reduction compresses data with many features into fewer dimensions while keeping the important patterns. If you have customer data with 50 variables, dimensionality reduction might reveal that only 5 underlying factors really matter. This is both useful for visualization and for making other algorithms run faster.
Reinforcement Learning: Learning From Consequences
How it works: An agent takes actions in an environment, receives rewards or penalties, and learns to maximize cumulative reward over time.
Analogy: A child learning to ride a bicycle. No manual with labeled examples. They try things (lean left, lean right, pedal harder), get feedback (stayed upright = good, fell = bad), and gradually learn the balance.
Key concepts:
- Agent: The learner (the algorithm making decisions)
- Environment: The world the agent operates in
- Action: What the agent does at each step
- Reward/penalty: Feedback on whether the action was good or bad
- Policy: The strategy the agent develops over time
Where reinforcement learning works: Game AI (AlphaGo, chess engines), robotics (warehouse robots learning to pick objects), autonomous vehicles (learning to navigate), resource optimization (data center cooling, ad bidding).
Why it’s different: Supervised learning needs labeled data. Unsupervised learning needs data with structure to discover. Reinforcement learning needs an environment where the agent can take actions and receive feedback. No dataset required — the data is generated through interaction.
✅ Quick Check: A video streaming platform adjusts its thumbnail images to maximize click-through rates. It tries different thumbnails, measures which ones get clicked, and gradually learns which visual style works best for each content type. Which ML type is this? Reinforcement learning — the platform takes actions (showing different thumbnails), receives rewards (clicks), and learns a policy that maximizes the reward (click-through rate). There’s no labeled dataset of “correct thumbnails” — the system learns from user behavior over time.
Key Terminology
| Term | Meaning |
|---|---|
| Feature | An input variable (square footage, age, pixel values) |
| Label/Target | The output the model predicts (price, category) |
| Training data | Data used to teach the model |
| Test data | Data held back to evaluate model performance |
| Model | The learned mathematical relationship between features and target |
| Prediction/Inference | Using a trained model on new data |
Key Takeaways
- Three types: supervised (labeled data → predictions), unsupervised (unlabeled data → patterns), reinforcement (actions + rewards → optimal strategy)
- Supervised learning has two tasks: classification (predict a category) and regression (predict a number)
- Unsupervised learning has two tasks: clustering (find groups) and dimensionality reduction (simplify)
- Reinforcement learning learns through trial and error in an environment — no labeled dataset needed
- Supervised learning dominates real-world business ML — if you have historical data with outcomes, start there
Up Next
You know the three types of ML. Lesson 3 dives into the specific algorithms that power each type — decision trees, random forests, neural networks, K-means, and more. You’ll learn what each one does, when it works best, and how to choose between them.
Knowledge Check
Complete the quiz above first
Lesson completed!