Notes

Sampling Bias

Sampling bias happens when the data you collect doesn’t represent the population you actually care about. It’s like trying to judge how spicy a whole restaurant’s food is after tasting only the “extra hot” dishes on the menu.

What it means (and what causes it)
Technically, sampling bias is a systematic error introduced by the way a sample is selected, so some kinds of people, events, or cases are more (or less) likely to be included than they should be. The key word is “systematic”: it doesn’t average out with more data if the collection process stays skewed. Common causes include selection bias (who gets into the dataset), nonresponse bias (who opts out), and coverage bias (who was never reachable by your sampling method).

Everyday examples
Sampling bias shows up in familiar places:

  • House prices: training on listings from upscale neighborhoods leads to overestimating prices citywide.
  • Exam scores: surveying only students who attended review sessions inflates “average preparedness.”
  • Medical measurements: a wearable-health dataset from fitness enthusiasts may miss patterns common in older or less active patients.

Why it matters in AI/ML
Machine learning models learn the patterns in the data they see. With sampling bias, a model can look accurate on a biased test set yet fail in the real world—especially for under-sampled groups. This can cause unfair decisions (e.g., credit scoring), brittle performance when deployed, and misleading validation metrics. It’s closely related to dataset shift and distribution mismatch: the training distribution differs from the deployment distribution.

How it’s handled in practice
Common mitigations include:

  • Better data collection: random or stratified sampling, improved coverage, follow-ups for nonresponse.
  • Rebalancing: sample weights, reweighting, or careful resampling.
  • Evaluation: subgroup metrics and stress tests that reflect real deployment conditions.

Sampling Bias occurs when the data collected are not representative of the target population due to a systematic selection process, causing estimates and model performance to be skewed. In AI/ML, it can lead to unfair, brittle, or poorly generalizing models because training and deployment distributions differ. Example: training a medical risk model mostly on data from one hospital may misestimate risk for patients from other regions or demographics.

Imagine you want to know what everyone in a city thinks about a new park, but you only ask people standing inside the park. You’ll probably hear more positive opinions than if you asked people all over the city. That’s sampling bias: when the data you collect doesn’t fairly represent the whole group you care about.

In statistics and AI, sampling bias happens when a dataset over-includes some kinds of people or situations and under-includes others. A machine-learning model trained on biased samples can learn a “skewed” view of the world and make unfair or inaccurate predictions.