By the end of this lesson, you will:
ℹ️ Definition Supervised Learning happens when machines learn from data that has labels (correct answers).
Think of it like learning with a teacher who shows you the right answers!
In machine learning, the "teacher" is the labels that guide the learning process.
Let's understand this with a fruit example:
Imagine you're taught:
Now, when you see this fruit:
You know it's an Apple because it's round and red! This is exactly how supervised learning works.
📝 Key Point In supervised learning, we provide the machine with examples AND their correct answers (labels) to help it learn patterns.
📊 BMI Dataset (Body Mass Index)
Weight(kg) | Height(cm) | BMI | Label ✅ |
---|---|---|---|
54 | 172.7 | 18 | Underweight |
68 | 172.7 | 24 | Healthy |
86 | 172.7 | 29 | Overweight |
🌸 Iris Flower Dataset
Sepal Length | Sepal Width | Petal Length | Petal Width | Label ✅ |
---|---|---|---|---|
5.1 | 3.5 | One.4 | 0.2 | Setosa |
4.9 | 3.0 | One.4 | 0.2 | Setosa |
6.0 | 2.2 | 4.0 | One.0 | Versicolor |
Supervised learning has 2 main categories:
Let's explore each one!
ℹ️ Definition Classification predicts which category or group something belongs to.
Think of it like sorting things into different boxes!
Examples of Classification:
Here's how email classification works:
ℹ️ Definition Regression predicts numbers based on patterns in data.
Think of it like predicting your test score based on how many hours you study!
Examples of Regression:
Here's the step-by-step process:
One. Collect Data 📊 We gather temperature and humidity readings:
2. Find the Pattern 🔍 The model draws a "line of best fit" through the data:
3. Make Predictions 🎯 Use the line to predict new values:
Feature | 📈 Regression | 📂 Classification |
---|---|---|
What it predicts | Numbers (continuous values) | Categories (groups) |
Output type | Numerical | Categorical |
Examples | Price: RM1,234Height: 165cm | Fruit: AppleEmail: Spam |
When to use | When you need a number | When you need a category |
Algorithms | Linear RegressionMultiple Linear Regression | KNNDecision TreeNaive Bayes |
💡 Remember
- Regression = Predicting numbers 📊
- Classification = Sorting into groups 📁
ℹ️ Definition Unsupervised Learning happens when machines learn from data without labels (no correct answers given).
Think of it like exploring a new place without a map - you have to find patterns on your own!
Without a "teacher," the machine must:
The machine looks at lots of data and finds natural groupings or patterns by itself.
Notice: No labels or answers! The machine must find patterns itself.
📊 BMI Dataset (No categories given)
Weight(kg) | Height(cm) | BMI |
---|---|---|
54 | 172.7 | 18 |
68 | 172.7 | 24 |
86 | 172.7 | 29 |
🌸 Iris Flower Dataset (No flower types given)
Sepal Length | Sepal Width | Petal Length | Petal Width |
---|---|---|---|
5.1 | 3.5 | One.4 | 0.2 |
4.9 | 3.0 | One.4 | 0.2 |
6.0 | 2.2 | 4.0 | One.0 |
📝 Key Difference Unlike supervised learning, we don't tell the machine what the correct answers are!
ℹ️ Definition Clustering groups similar things together without being told what the groups should be.
Think of it like organizing your toys - you might put all the cars together, all the dolls together, without anyone telling you to!
How Clustering Works:
Here's the process:
🛍️ Market Segmentation Group customers by shopping habits:
📺 Streaming Services
🏥 Healthcare
In this lesson, you learned:
Supervised Learning 👨🏫
Unsupervised Learning 🔍
💡 Quick Comparison
- Have labels? -> Use Supervised Learning
- No labels? -> Use Unsupervised Learning
- Need groups? -> Use Classification or Clustering
- Need numbers? -> Use Regression
📚 Explore more: Supervised vs Unsupervised Learning
📺 Supervised vs Unsupervised Learning Explained
📝 Practice with AI Try these prompts:
- "Explain supervised vs unsupervised learning with real examples"
- "When should I use classification vs regression?"
- "What are common clustering applications?"
🎯 Next Lesson: Machine Learning Process - Building Your First ML Model