← BackGrades 7-8 | Chapter 2: Understanding AI

Machine Learning Types 📊

Three Fundamental Approaches

Session 5: Supervised, Unsupervised, Reinforcement

Three Types of Learning 🤔

All machine learning falls into three categories, each with different ways of teaching AI.

The Three Types:

  • Supervised Learning: Learning with a teacher (labeled examples)
  • Unsupervised Learning: Learning without a teacher (find patterns)
  • Reinforcement Learning: Learning by trial and error with rewards

Think: How you learn differs in school (supervised), exploring (unsupervised), and playing games (reinforcement)!

Supervised Learning 👨‍🏫

Supervised learning is like learning from a teacher. You have labeled examples: "this is spam" and "this is not spam". AI learns to categorize new emails.

Real Examples:

  • Email filtering: Thousands of emails labeled "spam" or "not spam"
  • Medical diagnosis: Images labeled "tumor" or "no tumor"
  • Credit approval: Past loans labeled "approved" or "rejected"
  • Face recognition: Photos labeled with people's names

Key: Training data has the correct answer (label) for every example

How Supervised Learning Works 🔄

Process:

  1. Collect labeled data (training set)
  2. AI learns patterns from examples
  3. Test on new, unseen data
  4. Measure accuracy
  5. If accuracy is good, deploy!

Think: Teacher shows flashcards with answers, you memorize patterns, then you're tested on new cards

Classification vs Regression 📈

Two types of supervised learning problems:

Classification: Predicting Categories

  • "Is this email spam?" (Yes/No)
  • "Is this fruit an apple, orange, or banana?" (Category)
  • Output: A category or label

Regression: Predicting Numbers

  • "What will house price be based on size?" (Number)
  • "How many calls will a customer service get tomorrow?" (Number)
  • Output: A continuous number value

Unsupervised Learning 🔍

Unsupervised learning finds patterns WITHOUT labels. AI discovers structure on its own.

Real Examples:

  • Customer segmentation: Group customers by behavior (spenders, window-shoppers, etc.)
  • Gene clustering: Group genes by similarity
  • Recommendation: Group similar movies together
  • Anomaly detection: Spot unusual credit card transactions

Key: No labels! AI must discover patterns itself

Clustering: Grouping Similar Things 🎯

The most common unsupervised learning task. Group data into clusters based on similarity.

Example - Customer Segmentation:

  • No labels ("this is a big spender")
  • AI looks at behavior: amount spent, frequency, types of items
  • Automatically groups customers with similar patterns
  • Companies find 3 customer types without being told!

Reinforcement Learning 🎮

Reinforcement learning is learning by trial and error with rewards and punishments.

Real Examples:

  • Game AI: AlphaGo learned to play Go by playing millions of games
  • Robots: Learning to walk by trying and falling
  • Autonomous vehicles: Learning to drive safely
  • Trading bots: Learning to make profitable stock trades

Key: AI learns through interaction, getting rewards for good actions

How Reinforcement Learning Works 🔁

Process:

  1. AI takes an action (move in game, turn steering wheel, etc.)
  2. Environment responds (did it work?)
  3. AI gets reward (good action) or penalty (bad action)
  4. AI learns: which actions lead to rewards?
  5. Repeat millions of times
  6. AI becomes expert at maximizing rewards!

AlphaGo: The Game-Changer 🏆

Perfect example of reinforcement learning success.

AlphaGo (2016):

  • DeepMind's AI learned to play ancient game of Go
  • Go has more possible moves than atoms in universe!
  • Humans thought computers could never master it
  • AlphaGo defeated world champion Lee Sedol
  • How: Played millions of games against itself, learned from wins/losses

Choosing the Right Type 🤷

Use Supervised Learning When:

  • You have labeled training data
  • Clear right/wrong answers exist
  • You want to predict specific outputs

Use Unsupervised Learning When:

  • You want to discover hidden patterns
  • Labels don't exist or are expensive
  • You need to group similar things

Use Reinforcement Learning When:

  • Learning involves interaction with environment
  • Rewards/penalties exist
  • Complex decision-making is needed

What We Learned 🎓

  • Supervised learning: Learning from labeled examples (has teacher)
  • Classification: Predicting categories (spam/not spam)
  • Regression: Predicting numbers (price, quantity)
  • Unsupervised learning: Finding patterns without labels
  • Clustering: Grouping similar data
  • Reinforcement learning: Learning from rewards/penalties
  • Each type solves different problems!

Learning Types Mastered! 🎉

You understand how AI learns in different ways

Next Session: Bias in AI - The Critical Session