WEEK 3 Lesson 1
Title: Supervised vs Unsupervised Learning
Learning Objective
By the end of this lesson, learners will:
Understand what Machine Learning is
Distinguish supervised learning from unsupervised learning
Understand the role of labels in ML
Recognize common ML problem types
Identify real-world applications of each approach
Develop the ability to frame ML problems correctly
This lesson is about Machine Learning task understanding.
Before building models, engineers must understand what type of problem they are solving.
1. What is Machine Learning?
Machine Learning (ML) is a method where computers learn patterns from data.
Instead of writing rules manually, we allow algorithms to discover patterns automatically.
Traditional programming:
Rules + Data → Output
Machine Learning:
Data + Output → Learned Rules.
The system studies examples and learns how to produce predictions.
Examples:
• Predicting house prices
• Detecting fraud transactions
• Identifying spam emails
• Recognizing images
Machine Learning is essentially pattern recognition at scale.
2. Supervised Learning
Supervised learning is the most common type of Machine Learning.
In supervised learning:
The dataset includes labels.
Labels represent the correct answers.
Example dataset:
House Size Rooms Price
1200 3 200000
1500 4 250000
Here:
Features = House Size, Rooms
Label = Price
The model learns how inputs relate to outputs.
Example problems:
• Predicting loan approval
• Detecting fraudulent transactions
• Email spam detection
• Predicting customer churn
The algorithm learns by comparing predictions to the known answers.
3. Unsupervised Learning
Unsupervised learning works without labels.
The model receives data but no correct answers.
Its goal is to discover hidden structure in the data.
Example dataset:
Age Income Spending
25 40000 300
45 90000 700
The algorithm might discover:
• Customer groups
• Hidden patterns
• Similar behavior clusters
Common tasks:
Customer segmentation
Anomaly detection
Market basket analysis
Recommendation systems
The model organizes data based on similarity.
4. Key Difference: Labels vs No Labels
Supervised Learning:
Data + Labels → Learn Prediction
Unsupervised Learning:
Data Only → Discover Patterns
Supervised learning answers:
“What will happen?”
Unsupervised learning answers:
“What structure exists?”
Understanding this difference is the first step of ML problem framing.
5. Real-World Examples
Supervised learning examples:
Credit risk prediction
Medical diagnosis systems
Sales forecasting
Crop yield prediction
Unsupervised learning examples:
Customer segmentation
Fraud anomaly detection
Topic discovery in documents
Social network clustering
Different problems require different approaches.
6. Choosing the Right Approach
AI engineers always ask:
Do we have labeled data?
If yes → Supervised learning.
If no → Unsupervised learning.
Sometimes labels exist but are expensive to obtain.
In those cases engineers may:
Use unsupervised learning first
Then label clusters
Then train supervised models later
This hybrid strategy is common in real-world AI systems.
7. Problem Framing Mindset
Before coding, engineers define:
What is the goal?
What data do we have?
Are labels available?
What prediction are we making?
Example:
Goal: Detect fraud.
Data: Transaction history.
Labels available? Yes.
Conclusion: Supervised classification problem.
Correct framing prevents wasted effort.
Mini Practical Exercise
Students should:
Find three real-world problems.
Classify each as:
Supervised Learning
Unsupervised Learning
Explain the reasoning.
Example:
Spam Detection → Supervised
Customer Segmentation → Unsupervised
Write a short explanation for each.
Lesson Outcome
Students now:
✔ Understand Machine Learning fundamentals
✔ Distinguish supervised vs unsupervised learning
✔ Understand the importance of labels
✔ Recognize real-world ML applications
✔ Learn how to frame ML problems correctly
This is the foundation of Machine Learning thinking.
Next:
🔷 Week 3 Lesson 2 — Regression Models
Where students build their first predictive models.
Powered by Soft AI Africa | Training the Next Generation of AI Leaders in Africa.