Five Unplugged Machine Learning Activities for Class
The core ideas of machine learning (learning a rule from examples, testing it honestly, and noticing what the examples left out) can be taught with paper, cards and a few pens. These five activities need no screens, no code and no accounts, and each takes 45 minutes or less. They work in a classroom, a club or at a kitchen table.
The suggested ages are a rough guide. Younger children can do the simpler steps with more help; older ones can take on the counting and the discussion.
1. Sort the cards: invent a rule, then test it
Suggested ages: 7 and up. Time: about 30 minutes.
Materials: about 30 picture cards of animals, fruit or shapes (drawn or cut from old magazines), split into a "learning" pile of 20 and a "new" pile of 10. Put a green dot on the back of cards in group A and a red dot on group B. Choose a hidden grouping, for example "animals that can fly" against "animals that cannot".
Steps:
- In small groups, pupils look at the 20 learning cards with the dots showing and try to work out the rule that decides the color.
- Each group writes its rule in one sentence ("if it has wings, green").
- Turn over the 10 new cards one at a time. Each group uses its rule to predict the dot before you reveal it, and keeps score.
- Compare: which rules worked on the new cards, and which only worked on the learning pile?
What it teaches: machine learning means finding a rule from labeled examples (the dots are the labels), and the real test is new examples the rule has not seen.
Discussion question: A penguin has wings but cannot fly. What would your rule do with it, and how would you fix the rule?
2. A paper decision tree
Suggested ages: 9 and up. Time: about 40 minutes.
Materials: a set of 15 to 20 animal cards, or real leaves collected with permission from a garden or school ground; rulers if using leaves; large paper and pens.
Steps:
- Label every card or leaf with its group (for example "bird", "mammal", "fish", or "round" and "long" for leaves).
- Set 5 aside face down as a secret test pile.
- With the rest, pupils try yes-or-no questions ("Does it have fur?", "Is it longer than 6 cm?") and count how many cards each question leaves in the wrong group.
- The question with the fewest mistakes becomes the first box on the paper. Then repeat for each branch, stopping at three questions.
- Run the 5 secret cards through the tree and count how many it gets right.
What it teaches: how a decision tree chooses its questions from data, and why a tree that keeps adding very specific questions can memorize the cards instead of learning the pattern.
Discussion question: If you were allowed 20 questions, could you get every learning card right? Would that tree do better or worse on new cards?
3. A human neural network
Suggested ages: 10 and up. Time: about 40 minutes.
Materials: index cards, pens, a few animal picture cards, and a space for pupils to stand in three rows.
Setup:
- Input row (3 pupils): each answers one question about the animal card with 1 for yes or 0 for no: "Has feathers?", "Has fur?", "Lays eggs?"
- Middle row (2 pupils, the "neurons"): each holds a card with three weights, one for each input pupil, such as +2, minus 1, +1. They multiply each input by its weight, add the three results, and if the total is more than 0 they pass on a 1, otherwise a 0.
- Output pupil: holds two weights, one for each middle pupil, adds up the weighted votes, and says "bird" if the total is more than 0, otherwise "not a bird".
Steps:
- Show an animal card to the input row. Each input pupil calls out a 1 or a 0, the middle row calculates and passes on, and the output pupil announces the answer.
- If the answer is wrong, the teacher acts as the "error": the middle and output pupils each change one weight by 1 in the direction that would have helped.
- Try more cards. After a few rounds the network should make fewer mistakes.
What it teaches: a neuron just multiplies, adds and passes on a number; "learning" is adjusting weights after mistakes. Nobody in the network understands what a bird is, yet together they can get the answer right.
Discussion question: A bat has fur and flies. A platypus has fur and lays eggs. What does your network say about each, and why?
4. Train, then test: the secret pile
Suggested ages: 10 and up. Time: about 35 minutes.
Materials: around 40 cards showing simple drawings of "happy" and "not happy" faces drawn by pupils (made-up faces, not photos of anyone), a box for the secret pile, and a large 2 x 2 grid drawn on the board.
Steps:
- Mix the cards and put 20 in the secret box without looking. The other 20 are the training pile.
- Groups study the training pile and write rules for spotting a happy face ("mouth curves up").
- Open the box. For each secret card, a group applies its rule, then the card's real label is revealed.
- Tally each result into the grid: happy and called happy (true positive), not happy but called happy (false positive), not happy and called not happy (true negative), happy but called not happy (false negative).
- Work out accuracy: right answers divided by all 20.
For example, if a group's tally were 8 true positives, 2 false positives, 7 true negatives and 3 false negatives (a made-up result), the Model Accuracy Predictor, which works out accuracy, precision and recall from a confusion matrix, gives accuracy 0.75, precision 0.8 and recall 0.7273. Older pupils can do the same sums by hand; the guide to accuracy, precision and recall explains each one.
What it teaches: a model is only tested fairly on examples it never learned from, and its mistakes come in different kinds.
Discussion question: Which mistake is worse for a smoke alarm: going off when there is no fire, or staying silent when there is one?
5. The unfair dataset
Suggested ages: 10 and up. Time: about 30 minutes.
Materials: a set of pet cards (drawn or printed) with three kinds, for example cats, dogs and rabbits, labeled on the back.
Steps:
- Without telling pupils, build a training pile that has plenty of cats and dogs but no rabbits.
- Groups write rules for "cat" and "dog" from that pile.
- Test the rules on a pile that includes rabbits. Every rabbit has to be called a cat or a dog, so every rabbit is wrong.
- Reveal what was missing and ask groups to fix the training pile, not just the rule.
What it teaches: a model can only learn from what is in its data. If a kind of example is missing, the model fails on it, and nobody may notice until it is used on the real world. With people, that is how AI systems end up working worse for some groups than others. The guide to AI bias and fairness takes this further.
Discussion question: If a voice tool learned mostly from one accent, who might it struggle to understand? Whose job is it to check?
Tips for running them
- Use made-up or drawn examples. Never use photos, names or details of real pupils as data.
- Let groups get things wrong. The mistakes are where the learning happens, and they mirror what real models do.
- Write every result on the board, including the bad ones, and talk about why. Honest testing is the most important habit in machine learning.
- Older pupils who want to see the numbers grow can try the Dataset Size Calculator to see how much memory a class dataset of, say, 40 cards with 3 features would take (it is tiny).