g↗genai/ learner
Data and Evaluation / Lesson 01

Collecting representative data

A model learns patterns only from the examples it sees. Collecting representative data starts with defining who and what a model serves, then checking which people or conditions your sample leaves out—because more data alone does not fix a blind spot.

Concept + interactive labBeginner friendly

Start with who and what the model serves.

Think of tasting a pot of soup by skimming only the top layer of broth. You miss the vegetables and spices settled at the bottom, no matter how many spoonfuls you take from the top.

Data collection works in a loosely similar way: before gathering examples, you need to define both who will use the model and what real-world conditions it must handle. It is only an analogy—real datasets often span many overlapping people and environments.

This lesson introduces five ideas in order:

  1. Target population: the full set of people, items, or situations a model is meant to serve in real use.
  2. Sample: the subset of examples you actually collect to train or check the model.
  3. Representative sample: a sample that covers the key groups and conditions in the target population well enough for the model to learn patterns across them.
  4. Coverage gap: a group or condition that exists in the target population but is missing or too scarce in the sample.
  5. Sampling bias: a systematic skew in how examples are collected that makes some groups or conditions far more likely to appear in the sample than others.
Running example: Metro Bus Voice Helper

Imagine an invented city transit team building a voice assistant that answers spoken bus-route and arrival questions. To get started quickly, they collect 1,000 voice clips from office staff in a quiet downtown building—standing in for quiet indoor hall speech—during lunch.

To keep the comparison clear, each clip is assigned to one of four non-overlapping primary recording settings: quiet indoor speech, a dry busy roadside stop, inside a moving bus, or a rainy outdoor stop.

Recording settingInitial sampleStatus
Quiet indoor hallQuiet indoor speech (office stand-in for transit lobbies)1,000 clipsCovered
Busy roadside stopDry outdoor stop beside passing buses and traffic0 clipsMissing
Inside moving busRiders speaking over engine hum and cabin chatter0 clipsMissing
Rainy outdoor stopRiders speaking through wind and heavy rain0 clipsMissing

Illustrative counts: here “Covered” means examples of that setting appear in the sample (not a guarantee of production accuracy). The initial 1,000 quiet-office clips leave dry roadside stops, moving buses, and rainy stops completely missing.

Diagram titled Target population vs sample with subtitle Narrow collection leaves real-world settings out. Flows left to right from Target population (Quiet indoor hall, Busy roadside stop, Inside moving bus, Rainy outdoor stop) through Narrow collection (Quiet office only) to Collected sample showing Quiet indoor hall as Covered and the other three settings as Missing. Bottom cards show Analogy (Like tasting only the top broth of a soup pot.) and Key takeaways (Define who and what the model serves; Check which settings your sample leaves out; Narrow collection creates blind spots).
When collection reaches only one easy-to-access setting, the sample misses the rest of the target population.

Why more data is not always better data.

A common assumption is that more data is always better. In practice, adding more examples from the same narrow source only makes a skewed sample bigger—it does not fix a coverage gap.

Suppose the transit team gathers 9,000 more clips from the exact same quiet office, growing the sample to 10,000 clips. Because of sampling bias—collecting whoever is easiest to reach rather than where riders actually speak—the dataset is ten times larger yet still has zero clips from roadside stops, moving buses, or rainy weather.

10,000 narrow office clips

1,000 → 10,000 clips, all recorded in a quiet office.

Coverage stays at 1 of 4 settings. Three blind spots remain untouched.

1,600 varied clips

1,000 quiet clips + 200 clips in each of the three missing settings.

Far smaller than 10,000, yet all 4 of 4 settings now appear in the sample.

Outside the bus example: a skin-condition photo helper

Consider an illustrative health app trained on 50,000 clinic photos taken mostly on light skin tones under bright exam lights. Adding 50,000 more photos from the same bright clinic doubles the dataset size while still leaving darker skin tones and dim home lighting under-represented.

Diagram titled More data vs better coverage with subtitle Adding more narrow clips does not fix blind spots. Top lane compares 10,000 office clips (Quiet tall bar, Other 3: 0) pointing right to 1 of 4 settings covered (Blind spots remain). Bottom lane compares 1,600 varied clips (1,000 and 200 each across four bars) pointing right to 4 of 4 settings covered (All 4 settings seen). Bottom cards show Analogy (Like taking ten spoonfuls from the same spot.) and Key takeaways (More narrow data repeats the same skew; Targeted collection adds missing settings; Check coverage per group, not just total size).
A smaller targeted sample that spans all four settings can reduce blind spots far better than a huge sample drawn from one narrow source.

Spot the missing group in a sample.

In the activity below, inspect how a sample compares with the people and conditions the model is meant to serve, then test what happens when a team adds more narrow data versus targeted examples.

Worked trace: auditing the dry-afternoon bus sample

In Scenario 1, the team recorded voice clips in quiet halls (800), at busy roadside stops (220), and inside moving buses (180), but only on dry afternoons. Comparing those counts against the four target settings immediately exposes Rainy outdoor stop (0 clips) as the missing case.

  1. Start on 1. Find the missing group and click the missing setting in Metro Bus Voice Helper.
  2. Switch to City Bike-Share Demand and School Homework Helper to spot both a completely missing case and a scarce group.
  3. Switch to 2. Test “more data” and compare Add 9,000 office clips (10,000 total) against Add 600 targeted clips (1,600 total).
  4. Click Reset lab at any time to start fresh.
Choose a sample to audit

Who and what it serves: Riders asking spoken bus questions in quiet indoor halls, at dry busy roadside stops, inside moving buses, and at rainy outdoor stops.

How this sample was collected: Recorded across transit halls, roadside stops, and buses on dry afternoons, skipping rainy days.

Grouping criterion: Primary recording condition (quiet indoor, dry roadside stop, inside a moving bus, or rainy outdoor stop—non-overlapping)

Which group or setting is missing or severely under-represented in this sample?

Select one group above to check whether it is the coverage gap in this sample.

Illustrative lab: all scenarios, counts, and labels above are invented for this exercise rather than real measurements. “Covered” means examples appear in this illustrative sample (not a guarantee of sufficient real-world accuracy), and “Scarce” is a relative label within this example (8 essays versus 320–450 in each other band), not a universal numerical cutoff.

How to spot gaps before you train.

You do not need complex maths to catch obvious coverage gaps before a model is trained. Walk through three practical checks:

  1. Define who and what the model serves: list the real users, items, and operating conditions—including noisy, unusual, or high-stakes cases.
  2. Trace how examples were collected: ask who or what was easiest to reach, and who was left out by the collection method.
  3. Count coverage per group, not just total size: a large row count can hide groups with zero or very few examples.

Notice that a representative sample does not have to match exact real-world percentages in every case. Teams often intentionally collect extra examples of smaller or high-stakes groups so the model sees enough of them to learn useful patterns.

  • If a dataset has 100,000 examples, isn’t that big enough to be representative?

    No. Total size alone does not guarantee coverage—100,000 examples drawn from one narrow channel or setting can still miss entire groups of users.

  • Does representative mean every group must match its exact real-world percentage?

    Not necessarily. What matters is having enough examples of each relevant group and condition; teams frequently oversample small or critical groups.

  • If our sample covers every group, will the model make zero mistakes?

    No. Representative collection reduces blind spots, but models still face messy or missing values (Lesson 5.2), shifting real-world conditions, and prediction errors.

✎ Try it yourselfKnowledge check · Practice only

Check your understanding.

A city library is building a book-recommendation model meant to serve all library members—children, teens, adults, and seniors—across both print books and audiobooks. The team collected 20,000 borrowing records from the library's mobile audiobook app, which is used almost entirely by adult commuters, and plans to collect 30,000 more records from the same app to improve the model. What is the main problem with this plan?

Take this with you.

More data is not automatically better data. Start by defining the target population—who and what the model serves—then inspect your sample for coverage gaps and sampling bias. Adding more examples from the same narrow source only repeats the same blind spots; targeted collection helps bring missing groups into the sample.

Ready to continue? Return to Data and Evaluation.