- ID
- A1
- Edge teeth
- 0
- Length in cm
- 2
- Correct label
- Type A
Learning from labelled examples
Year 7 · Lesson 1 · Content 2026.11.02.1
All supplied-record lessons · Open interactive lesson
Supplied-record alternative. Enter your responses in your school assignment. These supplied results support learning but do not show that you ran an algorithm.
Your goal
Explain how examples with answers help a model sort a new leaf.
To be able to explain how labelled examples help a model classify new items.
Before you start
A leaf has a toothed edge and belongs to Type B. Which is the feature?
Choices: Toothed edge / Type B
Bridge feedback after trying
A feature describes the leaf; Type B is its known answer.
Words for this lesson
- Feature
- A detail measured or noticed in an example.
- Label
- The known answer attached to a training example.
- Training
- Using examples to set a model's numerical values.
The idea
People provide examples with known answers. This is called supervised learning. A feature is a detail such as the number of teeth on a leaf edge. A label is the leaf type. During training, a model uses the examples to set numerical values. It then predicts labels for different examples. We compare its predictions with the known answers. A test item must not be used to train this version.
A completed example
A practice sorter sees two labelled objects: a 2 cm stick labelled Short and an 8 cm stick labelled Long. Their lengths are features. Short and Long are labels. Testing a different stick checks whether the pattern helps beyond the practice examples. This example is separate from the leaf task.
Check your understanding
Which is a label?
- Type A
- Four centimetres
- Six edge teeth
Practice feedback after trying
Type A. A label is the known category, not a measured detail.
Which examples test this trained version?
- Different leaves kept out of training
- Only A1 again
- The teacher's opinion
Practice feedback after trying
Different leaves kept out of training. New examples check use beyond the training items.
Does adding more examples guarantee no mistakes?
- No, their quality and variety matter
- Yes, always
- Yes, if labels are hidden
Practice feedback after trying
No, their quality and variety matter. Extra incorrect or unrepresentative examples can still cause problems.
Task 1 · Make a prediction
Prediction for T1
Options: Type A / Type B / Needs review
Write your prediction, or state that you skipped it.
Try it using supplied records
- Read leaf A1. Select its feature and label. Read the other three labelled examples.
- Predict whether new leaf T1 is Type A or Type B. Press Train model. The site calculates one centre for each type.
- Press Test new leaves. Compare the four predictions with their known answers.
- Change A2 to the wrong label Type B. Retrain and retest the same four leaves. Record which prediction changed. Restore A2 afterwards.
Real small algorithm · nearest-centre training
Complete data and source records
| ID | Edge teeth | Length in cm | Correct label |
|---|---|---|---|
| A1 | 0 | 2 | Type A |
| A2 | 0 | 4 | Type A |
| B1 | 6 | 2 | Type B |
| B2 | 6 | 4 | Type B |
Read as stacked records
- ID
- A2
- Edge teeth
- 0
- Length in cm
- 4
- Correct label
- Type A
- ID
- B1
- Edge teeth
- 6
- Length in cm
- 2
- Correct label
- Type B
- ID
- B2
- Edge teeth
- 6
- Length in cm
- 4
- Correct label
- Type B
| ID | Edge teeth | Length in cm | Known answer |
|---|---|---|---|
| T1 | 0 | 3 | Type A |
| T2 | 6 | 3 | Type B |
| T3 | 2 | 4 | Type A |
| T4 | 4 | 2 | Type B |
Read as stacked records
- ID
- T1
- Edge teeth
- 0
- Length in cm
- 3
- Known answer
- Type A
- ID
- T2
- Edge teeth
- 6
- Length in cm
- 3
- Known answer
- Type B
- ID
- T3
- Edge teeth
- 2
- Length in cm
- 4
- Known answer
- Type A
- ID
- T4
- Edge teeth
- 4
- Length in cm
- 2
- Known answer
- Type B
Expected results · supplied
These are supplied reference results. They are separate from your own explanation. No code needs to run to read them.
1. Implement a nearest-centre classifier. Training computes the arithmetic mean of edge teeth and length separately for each label. Predict the label with the smallest squared Euclidean distance. Keep these units and features fixed for this toy dataset. Resolve equal distances as Needs review. Show distances only in More detail.
2. Correct labels give centres A=(0,3), B=(6,3), predictions A,B,A,B and 4/4 correct. With A2 relabelled B, centres A=(0,2), B=(4,10/3); predictions A,B,B,B and 3/4 correct. Retraining replaces centres; testing never updates them. Disable training if a class has no examples.
3. States: examples -> prediction recorded -> trained -> tested -> changed label -> retrained -> compared. A train action clears old test results and marks them stale until retested. Store both run records with the label state.
Help with this step
Hint 1
Find the column that describes the leaf, then the column naming its type.
Hint 2
A label is an answer supplied before training. Look at A2 in each run.
Hint 3
Worked parallel example: changing a stick label changes the examples used to calculate a group centre. It does not change the true length of a new stick.
Task 2 · Use the evidence
- Complete: The labels in our training set are __. One measured feature is __.
- Use the two test records to explain how changing a label affected T3.
- Explain why a new test leaf is more useful than repeating only a training leaf. Give one sensible check before using the classifier on real leaves.
My explanation
Write in your school assignment. Keep these answers in your own words.
Your explanation
- Training labels
- A measured feature
- What happened to T3 and why
- Why a new test helps and my next check
Explain a fresh example
A model predicts Type B for a new leaf. Explain how labelled examples helped it make that prediction and name one check you would make.
My confidence
I need another explanation / I can explain with help / I can explain with my own example
My next step
Write what you will do next.
Optional depth
Would four perfect test answers prove this classifier works for all plants? Explain what variety is missing.
What this activity can show
This is genuine numerical training of a very small nearest-centre classifier, not a neural network. Its two invented features cannot identify real plant species reliably.
This is a student learning record. Submission is completed through the school assignment system.