Learn the basics

Teach a computer with examples

Machine learning: instead of writing the rule, you show many examples and the computer finds the pattern. Then you test it on new ones.

examples car no car learns the pattern car: 92 % a new picture

Teach a computer with examples

Some jobs are easy to write as a rule: "if the distance is less than 15 cm, open the gate". Others are not: try writing a rule for "there is a car in this picture". Machine learning works the other way round: you show many examples of each kind, and the computer finds the pattern itself. That trained pattern is called a model.

Clear job with numbers: write a rule. Messy job with pictures, sounds or movements: train a model, then test it on examples it has never seen.

More: train your own model

Two free tools we use in class:

  • micro:bit CreateAI (in Chrome or Edge): the Micro:bit V2 learns movements. Record a few seconds of each move (swing, wave, still), train, test, then use the model in MakeCode.
  • Teachable Machine (Google, no account, the pictures stay on your computer): learns pictures, sounds or poses from the laptop camera or microphone. Make one class "car" and one "no car", record many examples of each, press Train, and try it with new things.
  • Many and different: film the toy car from all sides, near and far, in light and in shadow.
  • The other kind too: the model only learns "car" if it also sees many pictures without a car.
  • Test with new things: a different toy, a hand, an empty table. Where it fails, add examples.
  • It says how sure it is: "car: 92 %" is a guess, not a fact. Your program decides what to do with it.

Use toys and things, never photos of people. A model is only as good as its examples.