Zum Inhalt springen

English:Supervised learning with labelled examples - AI Year 5

Aus MOOCsWiki Staging
aiMOOC-Siegel aiMOOC

Supervised learning with labelled examples - AI Year 5

QR-Code



Introduction

Diagram of a sunflower with green leaves and arrows showing photosynthesis inputs and outputs
A plant illustration invites you to notice leaves. It explains photosynthesis; it is not our training dataset or evidence for identifying species. All classification cards below are invented.

How can examples help a machine make a prediction, and when should it ask for help? Fit a small paper classifier, keep new test cards separate and compare its results with a simple baseline. This Year 5 AI route is editorial enrichment linked to KS2 Computing data work, not a statutory annual AI syllabus. Use teacher-prepared fictional cards and no personal information.


Understand examples features and predictions


Begin with a labelled example

Imagine a teacher has drawn leaf cards for a sorting game. Each card has a colour, an edge description and a fictional group label. The groups Alpha and Beta are invented for this lesson. They are not real species and the cards are not observations of plants. Do not pick plants or use this activity to identify edible, poisonous or protected species.

A feature is an input description the method may use: here, colour and edge. A label is the target answer supplied on a training card: Alpha or Beta. A training example combines the features with that known label. A prediction is the output for a card whose label is not supplied to the prediction method. Saying green is a feature value; saying Alpha is the target label keeps their different jobs clear.

CodeAI, AI: What is Machine Learning? With your teacher, identify the examples, inputs and outputs in an explanation. The whole CodeAI unit is aimed at older learners; this lesson uses its selected explanation with concrete paper cards and teacher support. The videos introduce broader systems. They do not show or validate our invented dataset. You can complete the paper tasks using the text without watching them.


Fit a method from examples

In supervised learning, a method is fitted using examples with known target labels. Different methods represent what they learn differently. Some fit numerical parameters; others retain examples or other structures. Our small teaching method stores which labels occur for each exact colour-and-edge combination. This is a deliberately simple, memory-based classifier, not a neural network or a claim to match a commercial system.

For each training card, write its colour and edge together on a key card. Beside that key, keep the set of labels seen in training. Repeated occurrences of the same label do not add a new distinct label to the set. If both Alpha and Beta occur for a key, keep both; do not quietly delete one to make the problem look easier. This procedure is programmed by us, while the resulting key-to-label mapping depends on the supplied training examples.

At prediction time, inspect only the new card's features. A key with exactly one observed label gives that label as the prediction. A key with two observed labels gives ASK. A valid key not seen in training also gives ASK. ASK means the method abstains and a person should review the case; it is not a third botanical species and not a guarantee that all other predictions are correct.


Keep the test separate

Reserve test cards before fitting. Their features can be supplied when making predictions, but their answer labels stay with the teacher until predictions are recorded. Checking against those answers later is evaluation, not information the predictor received earlier. If you use the test labels to change the model and then score the same test again, those cards are no longer a fresh final test.

Teacher scaffold: point to one training row and say, The inputs are colour and edge; the known target is Alpha. Then cover the label on another card and ask which inputs the predictor may see. A learner who says it receives every future answer has confused training with prediction. Correct the claim: labelled examples help fit the method; they do not hand it the correct answer to every later case. More or varied evidence can help, but perfect future performance is not promised.



Fit and test a paper classifier


Work six training cards by hand

Copy these six invented cards. Row identifiers record which card is which; they are not extra prediction features. A smooth edge has no teeth in our drawing convention; toothed has small points; lobed has larger rounded divisions. These words describe paper features, not sufficient evidence for identifying a real species. The two green-lobed rows represent different fictional cards with different labels. That overlap alone does not prove either label was entered incorrectly.

Training card Colour Edge Known label
W1 green smooth Alpha
W2 yellow smooth Alpha
W3 green toothed Beta
W4 yellow toothed Beta
W5 green lobed Alpha
W6 green lobed Beta

Build the mapping before reading any test answers. Group rows by their two input features. Green-smooth and yellow-smooth each have Alpha; green-toothed and yellow-toothed each have Beta. Green-lobed has both Alpha and Beta. There is no yellow-lobed training row in this six-card set. The method must keep the overlap and the missing key visible.

Two separate withheld cards are WTestA: green-smooth and WTestB: green-lobed. First write a prediction for each without looking at its answer label. Hint: find the matching key, then count its distinct observed labels. Partial step: green-smooth has one label in the six training rows. Take your completed predictions to the worked checks later in the course, where the two answer labels are provided for evaluation.


Make eight new practice cards and reserve three tests

For the main practice, prepare eight fictional training cards using the table below. Cards P7 and P8 are distinct drawings with the same selected features and target; they are not an accidental duplicate record of one physical card. Card identities stay outside the selected feature pair. This is a small designed exercise, not a representative sample of real plants.

Practice card Colour Edge Known label
P1 green smooth Alpha
P2 yellow smooth Alpha
P3 green toothed Beta
P4 yellow toothed Beta
P5 green lobed Alpha
P6 green lobed Beta
P7 yellow lobed Beta
P8 yellow lobed Beta

Fit a new mapping from these eight training cards. Do not mix it with the earlier six-card mapping or silently change labels. There are three Alpha labels and five Beta labels. There are six distinct feature combinations, but green-lobed still has two different labels. Adding two yellow-lobed Beta cards does not resolve uncertainty for green-lobed cards. A label count is not a calibrated confidence score.

The three separately reserved test cards have features T1: green-smooth; T2: yellow-lobed; T3: green-lobed. Their labels are not in the program below. Write three predictions and freeze the list before opening the worked checks. The test cards are separate card identities, but their feature combinations occur in training. Therefore this tests new cards with familiar feature patterns; it does not demonstrate handling new feature values or generalising to real plants.


Optional teacher-supported executable version

The complete Python reference follows exactly the paper method. fit reads only labelled training rows and returns a new mapping; predict expects a mapping returned by fit and receives only colour and edge. Its permitted input values are explicitly bounded. Invalid values raise a clear error; a valid but unseen feature key produces ASK. An adult can run it in an approved offline Python environment. You do not need an account, camera, microphone, internet connection or a production AI service. Do the paper version first if the code is unfamiliar.

COLOURS = {"green", "yellow"}
EDGES = {"smooth", "toothed", "lobed"}
LABELS = {"Alpha", "Beta"}

def check_features(colour, edge):
    if type(colour) is not str or type(edge) is not str:
        raise ValueError("Use the stated text features")
    if colour not in COLOURS or edge not in EDGES:
        raise ValueError("Use the stated feature values")

def fit(rows):
    if type(rows) is not list or not 1 <= len(rows) <= 20:
        raise ValueError("Use one to twenty training cards")
    model = {}
    for row in rows:
        if type(row) not in (list, tuple) or len(row) != 3:
            raise ValueError("Each training row needs three items")
        colour, edge, label = row
        check_features(colour, edge)
        if type(label) is not str or label not in LABELS:
            raise ValueError("Use Alpha or Beta as the label")
        model.setdefault((colour, edge), set()).add(label)
    return {key: frozenset(labels) for key, labels in model.items()}

def predict(model, colour, edge):
    check_features(colour, edge)
    labels = model.get((colour, edge), frozenset())
    if len(labels) == 1:
        return next(iter(labels))
    return "ASK"

TRAINING = [
    ("green", "smooth", "Alpha"),
    ("yellow", "smooth", "Alpha"),
    ("green", "toothed", "Beta"),
    ("yellow", "toothed", "Beta"),
    ("green", "lobed", "Alpha"),
    ("green", "lobed", "Beta"),
    ("yellow", "lobed", "Beta"),
    ("yellow", "lobed", "Beta"),
]
TEST_FEATURES = [
    ("green", "smooth"),
    ("yellow", "lobed"),
    ("green", "lobed"),
]

if __name__ == "__main__":
    model = fit(TRAINING)
    for colour, edge in TEST_FEATURES:
        print(predict(model, colour, edge))

The script is finite: it predicts once for each of three test feature pairs, then exits. It does not train a large language model. A valid Python environment is needed to run it; copying text alone is not evidence you executed it. Keep your own observed outputs separate from the supplied reference and explain any difference before changing the cards.



Evaluate uncertainty and transfer carefully


Evaluate predictions with the same denominator

After recording your three predictions, ask your teacher for the reserved answer labels in the worked checks. For each test, record the predicted label or ASK, the answer label and the outcome. Keep three counts: correct labelled predictions, wrong labelled predictions, and ASK cases. Do not turn ASK into a correct species identification or hide those cases from the report.

Compare with a deliberately simple baseline: predict Beta for every test card because Beta is the more common label in the eight-card training set. Choose this baseline from the training counts, not from the test answers. Score both methods on the same three reserved cards. A method that answers fewer questions can look impressive if you quote only its accuracy among answered cases. Report how many of all three cases it answered as well as how often those answers were correct.

The expected counts appear in the worked checks after your attempt. A small result on three designed cards is classroom evidence about this exact procedure, not a dependable estimate of real-world accuracy. Other samples, feature patterns, labels or costs could change the outcome. Repeating the same three cases a hundred times does not create three hundred independent new tests.


Test an assumption instead of promising perfection

For the six-card worked model, a yellow-lobed card uses valid feature values but its key was absent in training; the expected output is ASK. For the eight-card practice model, that same feature pair has Beta in training, so its prediction changes. This is evidence that the fitted mapping depends on training data, rather than a table of future answers built into the predictor.

Changing the target label for the single green-smooth practice row from Alpha to Beta and fitting again changes that key's prediction to Beta. It does not prove Beta is the true answer for every green-smooth card. Preserve the original model and record the controlled change. Do not adjust a test answer to make the new prediction appear correct. A future test idea, not executed in the supplied reference, is a separate set of unseen cards drawn with a different edge-description guide. Agree how to record disagreements before testing it.

CodeAI, AI: Training Data & Bias. With teacher support, identify why the examples used and the people affected matter. Our fictional exercise does not measure fairness for people or establish that any real product is unbiased. More rows alone do not repair a missing perspective, unreliable target or a feature that does not serve the task. Do not upload pupil information or invent sensitive labels about classmates.


Transfer the questions and keep an evidence log

Suppose a separate imaginary library trial predicts a book's shelf label from language and binding. Leaf colour and edge no longer describe the task, so neither our trained mapping nor its score transfers. Define the shelf target, permitted features, trustworthy labels and a new split of training and test books. Compare with an agreed simple baseline and record errors. A wrong shelf suggestion may need staff correction; a wrong safety decision could be much more serious, so not every task is suitable for the same method.

Your evidence log should identify the dataset version, selected features, target labels, fit rule, separate test identities, frozen predictions, revealed answers, correct/wrong/ASK counts, baseline and one limitation. Include one change of training data and its observed consequence. The teacher can review paper traces and code outputs separately. A completed quiz or a technically valid course does not certify independent machine-learning expertise or practical plant identification.



Interactive Tasks


Quiz: Test Your Knowledge

What is the target label in this invented leaf-card task? (Alpha or Beta) (!The card identifier) (!The printed edge description) (!The colour value)



Which information is supplied to the prediction method for a reserved test card? (Its colour and edge) (!Its hidden correct label) (!All future correct answers) (!Its score after marking)



What does the six-card model store for green and lobed? (Both Alpha and Beta) (!Only Alpha) (!Only Beta) (!No observed label)



What is its prediction for a valid yellow-lobed key absent from the six training cards? (ASK) (!Alpha with certainty) (!Beta with certainty) (!The hidden test label)



Why is the method in this course fitted from examples? (Its key-to-label mapping changes with the supplied training labels) (!The predictor receives every future answer) (!It recognises all real plant species) (!Its predictions are guaranteed correct)



How many Beta labels occur in the eight-card practice training set? (Five) (!Three) (!Six) (!Eight)



Which baseline is chosen from that training set? (Predict Beta for every test card) (!Copy each hidden test answer) (!Count ASK as a correct label) (!Always report perfect accuracy)



How should an ASK case be reported? (Separately from correct and wrong labelled predictions) (!As an automatically correct species) (!As proof of a missing test card) (!As a reason to delete the case)



Why do these tests not establish real plant-identification accuracy? (They use a tiny invented dataset with familiar feature patterns) (!All green leaves must be Alpha) (!The video makes every prediction correct) (!The baseline was not a neural network)



What must change for a new library shelf-prediction task? (Define new relevant features labels and separate evaluation cases) (!Reuse leaf colour as the complete book description) (!Keep the leaf accuracy as proof of success) (!Let the model decide school privacy rules)





Memory Game

Feature An input description supplied to the prediction method
Label The target answer known for a training example
Training Fitting a method using the permitted examples
Prediction A model output for supplied input features
Evaluation Comparing frozen outputs with reserved answer labels
Baseline A simple reference method scored on the same test cases





Drag and Drop

A training row Contains features together with a known target label
A reserved test input Keeps the answer label out of the prediction call
One label stored for a key Returns that observed label in this teaching method
Two labels stored for a key Abstains with ASK rather than choosing silently
A new task context Needs a new target data and evaluation plan





Crossword Puzzle

FEATURE What names an input description?
LABEL What names the target answer?
TRAINING What fits the method using examples?
PREDICTION What names the output before checking the answer?
BASELINE What is the simple reference method?
EVALUATION What compares predictions with reserved answers?





LearningApps

Optional extra practice. Choose an appropriate activity with your teacher. If the external collection is unavailable, use the native activities and independent tasks in this course.


Cloze Text

Complete the explanation.
An input description is a

. The target answer is a

. Fitting uses the

examples. The output for supplied inputs is a

. A valid key with no observed label gives

. Two observed labels also give

. The more common training label in the practice set is

. Test answer labels are revealed only after predictions are

. An always-Beta method is our

. Results on invented cards do not certify real plant

.



Open Tasks


Easy

  1. Feature and label cards: Make four vocabulary cards for feature, label, training example and prediction. Match each to one actual row in the six-card table; explain why the row identifier is not a selected feature.
  2. Six-card mapping: Draw all keys observed in the six-card worked set and list their distinct labels. Hint: combine colour and edge. Ask for the worked key only after completing your own mapping.
  3. Two withheld predictions: Write predictions for WTestA and WTestB without using their answer labels. Show the matching key and the number of stored labels. Then compare with the worked check.
  4. Uncertainty explanation: Explain ASK in two sentences and draw a review symbol that does not depend on colour alone. Include why ASK is not another real species or an automatic correct answer.


Standard

  1. Eight-card training record: Fit the eight-card practice mapping on paper. Count Alpha and Beta rows, distinct keys and overlapping keys. Keep the original cards unchanged and identify P7 and P8 as separate fictional cards.
  2. Three-test evidence log: Freeze predictions for T1 to T3 before revealing their answers. Build a table with prediction, answer and correct, wrong or ASK outcome. Report counts using all three test cases.
  3. Baseline comparison: Use the training counts to choose the always-Beta baseline. Evaluate it on the same three reserved cases and compare all outcome counts with the paper classifier. Do not omit abstentions from your report.
  4. Teacher-supported code trace: Trace one valid observed key, one overlapping key and one valid unseen key using the appropriate six-card or eight-card model. If an adult runs the reference, record actual outputs separately from your prediction and investigate differences.


Advanced

  1. Controlled training change: Keep the original eight-card mapping, change only the first training label to Beta in a copy and fit again. Predict green-smooth with both versions. Explain why the difference is not evidence that you discovered a true species rule.
  2. Independent test design: Design the unexecuted different-drawing-guide test described in the chapter. State what is new, how labels will be kept separate and how disagreement will be recorded. Mark a proposal as untested until someone actually carries it out.
  3. Library shelf transfer: Plan a new fictional book-shelf task with language and binding as possible features. Justify the target, identify an assumption that may fail, reserve test cards and define a human fallback. Do not reuse the leaf model as proof.
  4. Error costs and review: Compare the consequences of a wrong fictional shelf suggestion with a wrong safety-related prediction. Explain why this classroom model should not decide real safety matters; propose a review record and an evidence limit for each scenario.



Learning Check

  1. Worked withheld leaf cards: After attempting the six-card method, evaluate WTestA green-smooth with answer Alpha and WTestB green-lobed with answer Beta. Explain each output.
  2. Practice test outcomes: After freezing your predictions, use the reserved labels T1 Alpha, T2 Beta and T3 Alpha. State all three outcomes and the coverage.
  3. Shared-denominator baseline: Evaluate the always-Beta baseline on those same three cases. Compare it with the classifier without changing denominators.
  4. Unseen valid key and changed evidence: Compare yellow-lobed under the six-card model and the eight-card model. Explain why adding rows does not resolve green-lobed.
  5. Changing a label and keeping the test honest: Change only P1 from Alpha to Beta and refit. What happens to a green-smooth prediction, and what must not change during marking?
  6. Transfer evidence and limitation: A library claims this leaf result proves its book-shelf model is ready. Evaluate the claim and propose the minimum honest next step.


Worked checks and assessment guidance

  1. WTestA predicts Alpha because that key has only Alpha, so it is correct. WTestB produces ASK because both labels were seen. Its answer label Beta is used only for evaluation; ASK remains an abstention, not a correct identification. The counts are one correct, zero wrong and one ASK.
  2. The frozen predictions are Alpha, Beta, ASK. T1 and T2 are correct; T3 is ASK. Thus two correct, zero wrong and one ASK from three tests, with answers provided on two of three. Two correct out of two answered cases omits the one unanswered case if presented alone.
  3. The baseline returns Beta, Beta, Beta: one correct and two wrong with no ASK. The classifier returns two correct and one ASK with no wrong labelled answer on these three cards. These are small designed results, not a stable real-world accuracy estimate; error costs and coverage matter.
  4. Yellow-lobed is absent from six-card training, so that model gives ASK. In eight-card training it has Beta only, so that model gives Beta. Green-lobed still has both Alpha and Beta. New examples of a different key do not eliminate that overlap, and repeating a known label does not establish confidence.
  5. The new green-smooth mapping contains only Beta, so its prediction changes from Alpha to Beta. The original model is preserved. Do not alter a reserved correct answer to match it or reuse test labels as training while claiming the same final test is independent.
  6. The claim is unsupported: leaf features, invented targets and three designed cases do not evaluate book shelving. Define a meaningful shelf label, relevant features and trustworthy examples, then use a separate reserved test with an agreed baseline, error counts and staff review. A paper or code demonstration is not professional certification.


Learning evidence

Keep the original six-card and eight-card tables, your own fitted mappings, two worked and three practice test predictions recorded before answer disclosure, a marked outcome table, the baseline comparison, one controlled training-label change and a limitation statement. Include vocabulary explanations and a proposed library transfer with an assumption check. A teacher should review your reasoning and distinguish a paper trace, a proposed test and an actually executed program. Quiz points document eligible activity outcomes; they do not prove independent practical expertise. Never submit real pupil identities, plant-safety decisions or a fabricated experiment.


OER and Wikipedia

Google for Developers: Supervised Learning supports the distinctions between features, labels, training, evaluation and inference. Its broader methods are not reproduced by this simple classroom mapping. The datasets, procedures, questions and worked explanations here are original fictional teaching examples, not measurements copied from that page.

Department for Education: Computing programmes of study, KS2 data and information work, is the curriculum anchor. This particular annual AI route is editorial enrichment, not a separately mandated Year 5 syllabus.

Commons image: Photosynthesis en.svg, At09kg, Wattcle, Nefronus, CC BY-SA 4.0. Unmodified diagram of photosynthesis. It supplies a plant context and visible leaves, not the fictional card labels, real leaf-classification evidence or model results.

CodeAI: AI: What is Machine Learning? and CodeAI: AI: Training Data & Bias are original publisher videos, embedded through YouTube. Their availability and embedding were rechecked on 15 November 2026. Use selected explanations with teacher scaffolding; the larger unit addresses older learners. No transcription or publisher endorsement is claimed. The course text provides a standalone alternative.

Supervised learning on Wikipedia gives optional background at a more advanced reading level; it is not the Year 5 worked dataset.


Linked learning areas


aiMOOC Projects



Schulfach+




aiMOOCs



aiMOOC Projekte









MOOCwiki · Deutsch

Nach dem Lernen ist vor dem Lernen

Entdecke direkt den nächsten Lernkurs. Weitere Inhalte erscheinen, wenn Du weiter nach unten scrollst.

Zur MOOCwiki-Hauptseite

Mediathek

Suche verfeinern

Dein Lernplan bestimmt, was oben steht. Alle anderen Inhalte bleiben erreichbar. Seitenaufrufe beeinflussen die Auswahl nicht.

Inhalte werden geladen ...

Mediathek wird aus dem Wiki geladen ...