AI Skill Course
Module 02 of 08
Lesson 02 · 32 minutes · Beginner

How do machines
actually
learn?

If a machine has no brain, no eyes, no childhood — what does it even mean for it to learn? In the next 32 minutes, you'll find out. You'll also train your very first AI. From scratch. In your browser.

You'll learn
Training, features, bias
You'll build
A fruit classifier
You'll meet
3 flavors of ML
Let's go
Part 01 · The shift

For 60 years, we told computers exactly what to do.
Then we tried something new.

Look at how engineers used to build a spam filter — vs. how it's built today. Same problem, completely different philosophy.

The old way

Rules. Lots of rules.

Engineers sat down, drank coffee, and wrote every possible rule they could think of. Then more. Then more. It never ended.

# spam_filter.py — circa 2002
if "FREE MONEY" in email:
  return "spam"
if "Nigerian prince" in email:
  return "spam"
if "V1AGR4" in email:
  return "spam"
# ...3,847 more rules
# Spammers found new tricks daily.
# Engineers cried.
Accuracy after 5 years ~70%
The new way

Show. Don't tell.

Don't write rules. Hand the computer a million labeled emails and let it find the patterns itself. Then it keeps learning, forever.

# spam_filter.py — modern ML
model = create_model()

for email, label in dataset:
  model.learn(email, label)

# That's it.
# The model figures out
# the patterns on its own.
# Even patterns YOU
# would never spot.
Accuracy today 99.9%
Part 02 · The magic word

Meet the most important word
in machine learning: "features."

Before a machine can learn anything, it needs measurable clues. Hover the creatures below to see what a computer "sees" when it looks at them.

🐱
Cat
Earspointy
Whiskerslong
Snoutshort
Bodysmall
🐶
Dog
Earsfloppy
Whiskersshort
Snoutlong
Bodymedium
🦁
Lion?
Earssmall
Whiskerslong
Snoutshort
Bodyhuge
🐺
Wolf?
Earspointy
Whiskersshort
Snoutlong
Bodymedium
The big idea

A "feature" is just a measurable clue.

Pointy ears? Short snout? Long whiskers? Each clue is a feature. The machine doesn't understand "catness" the way you do — it learns which combination of clues usually means "cat." That's it. That's the whole trick.

Notice the lion is mostly cat-features (huge body aside). The wolf is mostly dog-features. A well-trained AI would catch that.

Part 03 · Hands on

Now you train an AI.
From scratch. In 90 seconds.

Sort 8 fruits by tapping the correct label. Watch what the AI learns. Then test it on tricky cases.

Step 01 · Show it examples
Step 1 of 3
0
🍎 Apple bin
0
🍊 Orange bin
Training progress
Step 02 · See what it learned
Step 2 of 3
Color → orange Shape → round
The AI noticed pattern #1 Apples cluster toward red + round. Oranges cluster toward orange-colored + slightly less round.
It drew a decision boundary That dashed line is its "rule" — anything below it gets classified as one fruit, anything above as the other. You never wrote this rule. It found it.
This is literally all "learning" is Finding the boundary in feature space. Every modern AI — even ChatGPT — is doing a wildly fancier version of exactly this.
Step 03 · Test it on fruit it's never seen
Step 3 of 3

The AI will now classify 6 brand-new fruits — including some tricky ones designed to fool it. Watch it work.

Part 04 · The flavors

There's not just one way to learn.
There are three.

What you just did with fruits is one of three fundamental flavors of machine learning. Here are all three, with their everyday vibe.

01

Supervised

// Learning with a teacher

You give the AI examples with the correct answer attached. "This is a cat. This is a dog. Now you try." Most AI you use is this kind.

Real-world example
Photo + "cat" → photo + "cat" → photo + "dog"
...
AI: "I see a cat"
02

Unsupervised

// Learning with no teacher

You hand the AI a pile of data with no labels. "Find groups." It discovers patterns you didn't know existed — like customer segments.

Real-world example
10,000 customer records →
AI: "I found 4 distinct groups
you didn't know about."
03

Reinforcement

// Learning by trial & error

The AI tries things. Good outcomes = reward. Bad = penalty. It learns by doing — same way you'd train a dog. This is how AlphaGo learned Go.

Real-world example
Game move → lose: -1
Game move → win: +1
...10 million games later → master
Part 05 · The catch

An AI is only as good as
the data you feed it.

"Garbage in, garbage out" is the oldest rule in computing — and it's the single most underrated risk in modern AI. Toggle below to see why.

Diverse, representative dataset

10,000 photos of cats — different breeds, different lighting, different poses, day & night, indoors & outdoors.

What the AI learns

Robust pattern: "cat" The AI generalizes well. It correctly identifies cats it's never seen — black cats, sleeping cats, cats in shadow, cats from above.
Part 06 · Knowledge check

Five questions.
You've got this.

Wrong answers explain themselves — they're how the lesson finishes teaching you.

Question 01 of 05

0/5

Continue
Module 02 complete

You just trained an AI.
Few people can say that.

You understand features, training data, decision boundaries, and the three flavors of ML. You've felt firsthand how bad data leads to a bad model. That's not a beginner skill anymore.

Up next · Module 03

The AI hiding in your day

An interactive walkthrough of every AI-powered moment you'll encounter from waking up to going to bed — and the surprising tech behind each one.

Continue to Module 03