Lesson 4 13 min

Find the gap in the examples

Use group results to show how biased sampling can hide a model weakness.

Learning goal

I can explain how the way examples are selected affects what a model learns and what its scores show.

How it works

A training sample can underrepresent conditions the model will meet. This is one way bias can enter a system. An overall score may also hide uneven errors across groups or conditions. Compare group results and their counts, and investigate causes before drawing conclusions.

Think of it like this

Imagine learning a campus from photos taken only at noon. You might recognise buildings in daylight and struggle at dusk. A person can use signs and ask directions. An image model might have only the picture and the patterns it learned.

Worked example

The fictional Lantern Archive trains a badge recogniser on 20 bright pictures and 2 low-light pictures. In a balanced test it gets all four bright cases right and one of four low-light cases right. Reporting only five out of eight would hide where most mistakes occurred. The training mix suggests a reason worth testing. Camera angle could also matter, so the team collects varied examples and tracks several conditions in a fresh test.

What to remember

Look at which examples are present, which are missing, and how errors are distributed across the cases that matter.

  1. Bright photos4 correct out of 4.
  2. Low-light photos1 correct out of 4.
  3. Overall score5 correct out of 8, with very different group results.
The overall score combines the groups and hides the difference between them.

Key words

Bias
A pattern that can make a system work better for some cases or people than others. Missing or poorly chosen examples can contribute to bias.
Training data
Examples a model uses to learn patterns. The examples you choose can affect what it learns.
Test data
Examples held back during training and used to see how a model handles new cases.
More Machine Learning lessons

Activity

Audit the photo sorter

Materials Paper and the fictional results in this lesson.

  1. Make a table for bright and low-light photos. Record training counts of 20 bright and 2 low-light. Record test results of 4/4 and 1/4.
  2. Explain what a report of only 5/8 leaves out. Make a second report after moving one correct bright case to a separate condition and say which groups now have very little evidence.
  3. Propose a new sampling plan that includes more varied low-light scenes and a separate held-back test. Name a factor besides lighting, such as angle or background, that you would track.

Talk it through Different scores suggest a gap. A better sample and a fresh test are ways to investigate. Neither number tells you by itself why the gap exists.

Quick check

1. Which result makes the performance gap visible?
Answer and explanation

4 of 4 bright and 1 of 4 low-light. Separate counts show the model struggled far more in low light in this small sample.

2. What is a sound next step?
Answer and explanation

Collect more realistic low-light examples and test with fresh cases. More coverage and a fresh test help investigate the problem without guessing a cause.