Elena' s AI Blog

Lesson 2: How Machines Learn

07 Jan 2026 / 7 minutes to read

Elena Daehnhardt


What is AI? Cover
Course: What is AI?
Lesson 2 of 7 28%


TL;DR: Training data + Labels = Supervised Learning.

Data is Food ๐ŸŽ

AI needs data to learn, like we need food to grow

If you want to be strong, you eat vegetables. If an AI wants to be smart, it eats Data.

Human Growth:          AI Growth:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Food    โ”‚          โ”‚  Data    โ”‚
โ”‚  ๐Ÿฅ•๐ŸŽ๐Ÿฅ›  โ”‚    โ†’     โ”‚ ๐Ÿ“Š๐Ÿ“ท๐Ÿ“  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ†“                     โ†“
 Stronger!            Smarter!

Supervised Learning (School with a Teacher) ๐Ÿ‘จโ€๐Ÿซ

Supervised learning is like school with a teacher

This is like school with a teacher. The Teacher gives the AI a Training Set (Practice Test) and the Labels (Answer Key).

The Training Process:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Teacher holds up:   โ”‚
โ”‚ ๐ŸŽ "This is Apple"  โ”‚
โ”‚ ๐ŸŒ "This is Banana" โ”‚
โ”‚ ๐ŸŠ "This is Orange" โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Student (AI) learns:โ”‚
โ”‚ Red + Round = Apple โ”‚
โ”‚ Yellow + Long = Bananaโ”‚
โ”‚ Orange + Round = Orangeโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Example conversation:

  • Teacher: โ€œWhatโ€™s this?โ€ (shows red apple) ๐ŸŽ
  • Student AI: โ€œBall?โ€
  • Teacher: โ€œNo, Label = Apple.โ€
  • Student AI: โ€œOkay, Red + Round + Stem = Apple.โ€ โœ…

The AI adjusts its internal rules until it gets it right!

๐ŸŽฎ Real-World Connection

This is how Face ID learns YOUR face! Someone (you!) shows it your face many times (training data) with the label โ€œThis is the owner.โ€ Then it learns to recognize you!

Activity: Be the Algorithm! ๐Ÿค–

YOU are the AI now! I will give you Training Data to teach you how to spot a โ€œHappy Sentenceโ€.

Training Phase:

DATA 1: "The sun is shining." โ†’ LABEL: HAPPY โ˜€๏ธ
DATA 2: "I dropped my ice cream." โ†’ LABEL: SAD ๐Ÿ˜ข
DATA 3: "I got an A+!" โ†’ LABEL: HAPPY ๐Ÿ˜Š
DATA 4: "My puppy is cute!" โ†’ LABEL: HAPPY ๐Ÿถ
DATA 5: "I failed the test." โ†’ LABEL: SAD ๐Ÿ˜”

Now Test Yourself!

Based on what you learned, label these:

  1. โ€œMy puppy is sleeping.โ€ โ†’ ??
  2. โ€œItโ€™s raining on my birthday.โ€ โ†’ ??
  3. โ€œIโ€™m dying of laughter!โ€ โ†’ ??
  4. โ€œI love ice cream!โ€ โ†’ ??
Click for answers! **Suggested Answers:** 1. **HAPPY** (puppies usually = happy context!) 2. **SAD** (rain on birthday = disappointing) 3. **HAPPY** ("dying of laughter" means laughing a lot!) 4. **HAPPY** (love = positive!) **Notice:** #3 is tricky! "Dying" sounds sad, but "laughter" is happy. **This is why AI needs LOTS of examples to understand context!**

What Did You Just Learn?

You just experienced supervised learning! You:

  1. Saw examples (training data)
  2. Saw labels (happy/sad)
  3. Found patterns (certain words โ†’ certain feelings)
  4. Applied those patterns to NEW data

Thatโ€™s exactly what AI does! ๐ŸŽฏ

The Three Ingredients of AI Learning ๐Ÿฅ˜

1. Training Data

The examples you show the AI. More data = Smarter AI!

2. Labels

The โ€œanswersโ€ for each example. โ€œThis is a catโ€ or โ€œThis is a dogโ€

3. The Algorithm

The math that finds patterns. (We wonโ€™t worry about the mathโ€”just know itโ€™s happening!)

Recipe for AI:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1000 cat photos (DATA)   โ”‚
โ”‚ + "cat" labels (LABELS)  โ”‚
โ”‚ + Pattern finder (ALGO)  โ”‚
โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚ = Cat Detector AI! ๐Ÿฑ   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Junk Food = Junk AI! ๐Ÿ”๐Ÿ’ฉ

Biased training data creates biased AI

If you eat only candy, youโ€™ll feel sick. If you teach an AI only bad data, it learns bad patterns!

This is called Bias.

Real Example 1: The Doctor Problem

Bad Training Data:

  • 900 photos of male doctors
  • 100 photos of female doctors

What AI Learns: โ€œDoctors are usually men.โ€

The Problem: The AI now thinks women canโ€™t be doctors! Thatโ€™s bias!

Real Example 2: Facial Recognition

Some facial recognition programs struggle to see people with darker skin.

Why? The engineers mostly trained them on photos of people with lighter skin.

The Fix: Train with DIVERSE data representing everyone!

Bad Data = Biased AI:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 90% Group A  โ”‚ โ†’  AI assumes everyone
โ”‚ 10% Group B  โ”‚    is like Group A!
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Good Data = Fair AI:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 50% Group A  โ”‚ โ†’  AI recognizes
โ”‚ 50% Group B  โ”‚    everyone equally!
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Golden Rule:

๐ŸŒŸ Garbage In, Garbage Out ๐ŸŒŸ

If you feed AI junk data, you get a junk AI!

More vs. Better Data ๐Ÿ“Š

Question: Whatโ€™s betterโ€”more data or better data?

Answer: Both! But QUALITY matters more than QUANTITY.

SCENARIO 1:
1,000 blurry cat photos = Bad AI

SCENARIO 2:
500 clear, diverse cat photos = Good AI

Better to have 500 good examples than 1,000 bad ones!

Try It Yourself: Spot the Bias! ๐Ÿ”

Imagine youโ€™re building a โ€œGood Bookโ€ detector.

Training Data:

  • 50 books you love (labeled โ€œGOODโ€)
  • 50 books you hate (labeled โ€œBADโ€)

Question: Will this AI work for OTHER people?

Click for answer! **NO!** This AI will only match YOUR taste! **The Problem:** The data is biased toward YOUR preferences. **The Fix:** Get training data from MANY different people with different tastes!

๐ŸŽ‰ Achievement Unlocked: Data Detective! Level: Student (2/6 complete)

๐Ÿ“ Todayโ€™s Key Concepts

Supervised Learning:
- Training Data (examples)
- Labels (answers)
- Algorithm (pattern finder)
= Trained AI!

Bias:
- Bad/unfair data
- Leads to unfair AI
- Example: Only photos of male doctors

Quality > Quantity:
- 500 good examples better
  than 1,000 bad examples!

Remember:
"Garbage In, Garbage Out"

Quick Quiz ๐Ÿ“

  1. What is the โ€œAnswer Keyโ€ called in training?
  2. What happens if you train an AI only on green apples?
  3. If you feed an AI โ€œjunk foodโ€ (bad data), what happens?
  4. Who provides the labels in Supervised Learning?
  5. True or False: AI memorizes every specific image it sees.
Click for Answers! **Answers:** 1. **Label** (or "ground truth") 2. **It won't recognize red apples!** (It learns the wrong pattern) 3. **You get a junk AI!** (Garbage In, Garbage Out) 4. **Humans!** (The teacher provides labels) 5. **False!** It learns *patterns* (like "pointy ears"), not specific images **Your Score:** - 5/5: ๐ŸŒŸ Training Expert! - 3-4/5: โญ Learning Well! - 1-2/5: ๐Ÿ’ซ Review the lesson!

๐Ÿ” AI Detective Says:

โ€œWhenever you hear about an AI making unfair decisions (like rejecting loan applications unfairly), ask: What data was it trained on? Often the problem is biased training data, not the AI itself!โ€

๐Ÿ’ก Parent/Teacher Discussion

Great conversation starter: โ€œIf we built an AI to detect โ€˜good students,โ€™ what data would we need? Would test scores alone be fair? What else should we consider?โ€ This helps kids think critically about fairness in AI.

๐ŸŒŸ Hands-On Activity

Be a Data Collector!

  1. Find 10 photos of dogs online
  2. Find 10 photos of cats
  3. Notice: Are they all the same angle? Same lighting? Same breed?
  4. Think: Would these 20 photos be enough to train an AI? Why or why not?

Next up: How does AI actually process all this data? Weโ€™ll peek inside the Neural Network!


This post is part of the What is AI? series.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2026) 'Lesson 2: How Machines Learn', daehnhardt.com, 07 January 2026. Available at: https://daehnhardt.com/courses/book_ai/02-training/
Course Library