Learning Goals
5 minBy the end of this lesson you can:
- Explain that training means showing labelled examples.
- Name the three steps: examples → model → prediction.
- Explain why we test a model on new examples.
Warm-Up · How Did You Learn "Spicy"?
8 minLast lesson you finished the detective unit. Now we look at how AI actually learns.
Nobody gave you a rule for "spicy". How did you learn it?
Reveal the thinking
You tasted examples — sambal was spicy, rice was not. After a few, you could judge new foods. That is exactly how we train an AI.
New Concept · Training a Model
18 minWhat is training?
Training is showing an AI many examples, each with a label (the right answer), until it learns the pattern. The learned pattern is called the model.
A label is just the name we attach: this photo is a "cat", that one is a "dog".
The three steps
Why we test
After training, we show the model new examples it has never seen. If it gets those right, it really learned the pattern — it didn't just memorise.
Always test on fresh examples. A model that only works on the photos it trained on hasn't truly learned.
Worked Example · Smile or Frown?
18 minLet's train a tiny model to tell a smile from a frown in simple face sketches.
Step 1 — Labelled examples
We show it sketches, each labelled: mouth curving up = "smile"; mouth curving down = "frown". We give plenty of each.
Step 2 — The model learns
It spots the pattern: the direction of the mouth curve decides the label.
Step 3 — Predict a new face
We draw a fresh face it has never seen, with an upward curve. The model predicts: "smile".
What it would say
New sketch -> Smile (90% sure)
Frown (10% sure)We never wrote "up = smile". We showed labelled examples, and the model worked out the rule itself.
Try It Yourself
20 minUse your worksheet.
You're teaching "circle" vs "square". Draw or list six examples and write the label next to each.
Hint
Include different sizes and a few wobbly ones — variety helps the model.
For your "circle vs square" model, describe one new example you would use to test it, and what it should predict.
Hint
Choose something not in your training set — maybe a rounded square to see if it's fooled.
Mini-Challenge · Design the Training Set
12 minDesign the examples to teach an AI thumbs up vs thumbs down.
List your labelled examples, then a separate test example for each label.
It works if your training examples are varied and balanced, and your test examples are new (not in the training set).
Show one good plan
Training: 8 thumbs-up (left hand, right hand, near, far) labelled "up"; 8 thumbs-down labelled "down". Test: a brand-new thumbs-up at a tilt, and a thumbs-down with a different background.
Recap
5 minTraining means showing labelled examples until the model learns the pattern. The three steps are examples → model → prediction. We test on fresh examples to check it truly learned.
Vocabulary Card
- training
- Showing an AI labelled examples so it learns a pattern.
- label
- The right answer attached to an example, like "smile" or "cat".
- test set
- Fresh examples, kept aside, used to check the model really learned.
Homework · Teach Your Tastes
≤ 20 minImagine training an AI to tell your favourite foods from your not-favourite ones. Write the labelled examples you'd show it (at least four of each), then one new test food for each label.
Sample · My Tastes
Favourite (label "yes"): nasi lemak, satay, cendol, kaya toast.
Not-favourite (label "no"): bitter gourd, plain porridge, black coffee, raw onion.
Test: mee goreng (should predict "yes"); steamed okra (should predict "no").
Yours will be different — clear labels and fresh test foods are what matter.