Lesson 5 of 12 · How machines learn · Teacher's plan
Teach a machine by example
Groups write a rule from labelled leaf cards, test it on cards the teacher held back, count their accuracy and improve the rule.
Students will be able to
- write a simple rule from labelled examples
- explain the difference between training data and testing data
- work out accuracy as the number right out of the number tested
- explain why more and more varied examples usually give a better rule
Prepare
- For each group: 8 training cards, each showing a leaf with its features and a label (Tree A or Tree B)
- 6 testing cards with the same features but no label, kept by the teacher
- An answer key for the testing cards
- One worksheet per student
Words to know
- Label:
- The right answer attached to an example, such as "Tree A".
- Training data:
- Labelled examples used to learn a rule.
- Testing data:
- New examples kept back to check whether the rule works.
- Accuracy:
- How many answers were right out of how many were tried, such as 5 out of 6.
Main activity · Unplugged: paper and pens
The leaf sorter
Groups study labelled leaf cards (shape, edge, length, colour) and write a rule for telling Tree A from Tree B. The teacher then shows held-back cards, groups apply their rule, count how many they got right and improve it, which is how machines are trained and tested.
ManuAI pages for this lesson
- How machines learn ai.manusignal.com/lessons/how-machines-learn
- Hot or cold word game (optional) ai.manusignal.com/play/lab/hot-or-cold
The 45-minute plan · 45 minutes
| Warm-up6 min | How did you learn that?
|
|---|---|
| Activity18 min | Train, then test
|
| Practice16 min | Improve the rule
|
| Wrap-up5 min | Train, test, improve
|
Teacher tips
- Making cards: draw simple leaves by hand and write the features under each one (shape, edge smooth or jagged, length in cm, colour). Make two or three cards in each set that break the obvious pattern so groups get something wrong the first time.
- Mixed levels: groups who score 6 out of 6 quickly can write a rule using two features together, or try to write a rule that is too strict and show how it fails on testing cards.
- Misconception: "the machine understands leaves". It only follows the features and patterns in its examples. If a feature it relies on is missing on a new card, it will guess badly.
Exit ticket answers
- A group's rule got 9 out of 12 testing cards right. What is its accuracy? A. 9 out of 12 (three quarters)
- Which data should be kept back and only used at the end to check the rule? C. Testing data
- Why does giving a machine more and more varied examples usually help? A good answer: It sees more of the kinds of case it will meet, so its rule fits real examples better and makes fewer mistakes on new ones.