New
New
Lesson 3 of 6
  • Year 9

Training and testing a model

I can train a machine learning model and test the model’s predictions.

Lesson 3 of 6
New
New
  • Year 9

Training and testing a model

I can train a machine learning model and test the model’s predictions.

These resources were made for remote use during the pandemic, not classroom teaching.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

Lesson details

Key learning points

  1. A classifier's predictions are only as accurate as their training data allows.
  2. Classifiers can still make predictions with a high confidence score, even if the training data is poor.
  3. Causes of poor training data include: outliers, limited training data and poorly labelled data.
  4. It is important to test a classifier to make sure the outputs are as expected.

Keywords

  • Training data - a set of examples used to teach a machine learning model how to recognise patterns

  • Prediction - the output that a model generates based on the patterns determined from the training data

  • Confidence - a measure of how likely the output of a model is correct

  • Bias - to disproportionately favour one side, group, or outcome over others

  • Outlier - a data point that significantly differs from the rest of the data in a data set

Common misconception

More training makes a perfect model.

Not neccessarily - models can become too specialised and fail on new data.


To help you plan your year 9 computing lesson on: Training and testing a model, download all teaching resources for free and adapt to suit your pupils' needs...

File needed for this lesson

  • microbit-Oak 1.29 MB (HEX)

Download this file to use in the lesson.

It is important to point out to pupils that classifiers can still make predictions with a high confidence score even if the training data is poor.
Teacher tip

Equipment

Pupils will need access to a physical device to capture data and a means of creating a data-driven application. Examples in this lesson use micro:bits and CreateAI https://oak.link/createai

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

Prior knowledge starter quiz

Download quiz pdf

6 Questions

Q1.
Why is it important to hold the micro:bit in the same position when recording movement samples?

to make the device look more organised
Correct answer: to ensure data is consistent and reduce variability
to speed up the recording process
to randomly change the motion values for more variety

Q2.
A approach involves using patterns in data rather than predefined rules.

Correct answer: data-driven
rule-based

Q3.
Which axis changes the most when moving a device side to side?

Correct answer: x-axis
y-axis
z-axis

Q4.
A is a collection of similar data samples grouped together under a label.

Correct Answer: class

Q5.
A data-driven system requires a large number of to learn patterns.

Correct Answer: samples

Q6.
Why do we need to collect multiple samples for a model?

to introduce random variations in the data set
Correct answer: to make sure the model identifies consistent patterns
to make the program run slower
so the computer has more numbers to store

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
What is training data in machine learning?

the final output of a model
the process of deleting unwanted data
data collected after testing the model
Correct answer: a set of examples used to teach a model how to recognise patterns

Q2.
A classifier uses in a model to predict which class new data belongs to.

Correct Answer: boundaries

Q3.
What is an outlier in a data set?

Correct answer: a data point that is significantly different from the rest of the data
a value that is exactly the same as all others
the most frequently occurring value in the data set
a missing value that does not affect model performance

Q4.
What is a classifier in machine learning?

a type of program that stores data
Correct answer: a machine learning algorithm that groups data into categories
a system that erases training data after use
a way to manually sort data into a spreadsheet

Q5.
Match the term with its definition.

Correct Answer:classifier,a model that sorts data into categories

a model that sorts data into categories

Correct Answer:training data,a set of examples used to teach an AI model

a set of examples used to teach an AI model

Correct Answer:prediction,the model's output based on recognised patterns

the model's output based on recognised patterns

Correct Answer:outlier,a data point that differs significantly from the rest

a data point that differs significantly from the rest

Q6.
Why is it important to test a model with different people?

to make the model more complicated
to see if the computer makes mistakes on purpose
Correct answer: to ensure the AI can adapt to different movement styles and reduce bias
to collect random results without a clear purpose