How computers learn from data: training a simple AI model – Year 9 Computing lesson
Pupils learn to explain how a machine learning model is trained on example data, test its predictions and spot bias in its training data.
Lesson 4 of 6 in unit 9.5 Modelling the Real World, taught in Year 9, Summer 1. It answers one big question: How can a computer learn to make predictions from data?
By the end, pupils can explain how a machine learning model is trained on example data, test its predictions and spot bias in its training data.
- The Build (the main task)
- Write a rule from 12 days of training data that predicts a long lunch queue, test it on four new days, and explain how the training data could make it biased.
- Support version
- Part-filled tally table: the training days are already grouped by weather and menu, with sentence starters for the rule and the bias.
- Challenge
- Suggest what extra training data would make the model fairer, and why.
- Real-world link
- Instead of coding rules, pupils 'train' a model on past lunchtimes to predict whether the queue will be long.
- Key words
- Machine learning, Training data and Bias, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “A programmer writes the rules a machine learning model follows”; “More training data always makes a model fair”.
- National Curriculum
- NC1 (design, use and evaluate abstractions that model real-world problems and physical systems); NC3 (two or more languages, at least one textual; data structures; modular programs with procedures or functions).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils can do it all on paper.
Also sold in the Modelling the Real World unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Single-teacher licence: use and adapt it with your own classes
More for KS3 Computing
See allPupils learn to use abstraction to decide which details a model needs, and state the assumptions it makes.
Free sample lessonPupils learn to describe a state transition diagram for a real system as a typed state table, with the rule that triggers each transition.
Pupils learn to write a Python simulation that uses random numbers in a function and a loop to predict the length of a queue.
Written for the specifications named. Not endorsed by or affiliated with any exam board.