The big idea

What is machine learning?

Normal programs follow rules a person wrote. I'm different: show me examples and I'll figure out the rule myself. A crowd of monsters just arrived. Tap one to teach me!

A normal program

A person writes the rules. The computer just follows them.

RulesDataAnswers

Machine learning

We give examples with answers. The computer works out the rules. That rule-finder is called a model.

DataAnswersRules (model)

Try it: teach Robo a secret rule

Look
Guess
Check
Tweak

Checkpoints — Robo's brain saved along the way. Tap one to look back.

They'll appear after 1, 3, 10, 25 and 50 examples.

How it works

Look

Robo sees the monster you tapped: how big, how blue, how spiky, how many eyes. Just numbers!

Guess

It multiplies each number by how much it cares about it, adds them up, and guesses.

Check

Then it gets the real answer and sees how wrong it was.

Tweak

It nudges its "how much I care" numbers a little, so next time it would be less wrong.

What just happened?

The ways machines learn (this course)

For grown-ups: what's really going on

Robo is a logistic regression classifier, the simplest real ML model. Each monster is a feature vector x = [size, blueness, spikiness, eyes] in [0, 1].

  • Guess: p(friendly) = σ(w·x + b), where σ is the sigmoid.
  • Check: the loss is cross-entropy between p and the true label y ∈ {0,1}.
  • Tweak: one step of stochastic gradient descent per example: w ← w − η (p − y) x, b ← b − η (p − y).
  • Test score is accuracy on 60 fixed monsters Robo never trains on, so it measures generalisation, not memory.
  • “Big AND blue” is still linearly separable, so logistic regression can learn it; a rule like “big XOR blue” would need a neural network (see Chapter 3).