By the end of this lesson, you will:
:information_source: 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.
:memo: Key Point In supervised learning, we provide the machine with examples AND their correct answers (labels) to help it learn patterns.
:bar_chart: BMI Dataset (Body Mass Index)
Weight(kg) | Height(cm) | BMI | Label :white_check_mark: |
---|---|---|---|
54 | 172.7 | 18 | Underweight |
68 | 172.7 | 24 | Healthy |
86 | 172.7 | 29 | Overweight |
:emoji: Iris Flower Dataset
Sepal Length | Sepal Width | Petal Length | Petal Width | Label :white_check_mark: |
---|---|---|---|---|
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!
:information_source: 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:
:information_source: 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 :bar_chart: We gather temperature and humidity readings:
2. Find the Pattern :mag: The model draws a "line of best fit" through the data:
3. Make Predictions :dart: Use the line to predict new values:
Feature | :chart_with_upwards_trend: Regression | :emoji: 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 |
:bulb: Remember
- Regression = Predicting numbers :bar_chart:
- Classification = Sorting into groups :file_folder:
:information_source: 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.
:bar_chart: BMI Dataset (No categories given)
Weight(kg) | Height(cm) | BMI |
---|---|---|
54 | 172.7 | 18 |
68 | 172.7 | 24 |
86 | 172.7 | 29 |
:emoji: 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 |
:memo: Key Difference Unlike supervised learning, we don't tell the machine what the correct answers are!
:information_source: 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:
:emoji:️ Market Segmentation Group customers by shopping habits:
:emoji: Streaming Services
:emoji: Healthcare
In this lesson, you learned:
Supervised Learning :emoji::emoji:
Unsupervised Learning :mag:
:bulb: Quick Comparison
- Have labels? -> Use Supervised Learning
- No labels? -> Use Unsupervised Learning
- Need groups? -> Use Classification or Clustering
- Need numbers? -> Use Regression
:books: Explore more: Supervised vs Unsupervised Learning
:emoji: Supervised vs Unsupervised Learning Explained
:memo: 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?"
:dart: Next Lesson: Machine Learning Process - Building Your First ML Model