What is Sampling Bias?

Sampling bias usually comes from how data was gathered, not from a decision to leave anyone out. A support model is trained on tickets from the web form, while phone customers, who may raise different problems, are logged in another system. A fraud model learns from cases that investigators chose to review, so the patterns it sees are the ones investigators already suspected.

Common forms:

  • outcome-dependent selection: whether a record enters the dataset depends on the outcome or on a related trait
  • survivorship bias: only cases that reached a later stage, such as approved loans, have outcomes recorded
  • coverage gaps: a region, channel, product line or period is missing or thin
  • convenience sampling: the easiest data to get stands in for the data the task will meet

How is sampling bias different from class imbalance?

  • Class imbalance means one outcome is rare in the data, such as fraud among card transactions. Imbalanced data can still reflect reality accurately.
  • Sampling bias means the data does not reflect the population the model will serve. A rare class may be over- or under-represented, or whole groups may be missing.
  • Class imbalance can be handled with resampling or class weights, as covered in class imbalance correction. Sampling bias needs the missing groups and cases identified first, because reweighting cannot add a group that was never collected.

Where does sampling bias break in AI work?

A lender trains a default model on its approved loans, because those are the only loans with repayment outcomes. The model is then used to screen all applicants, including kinds of applicants it never saw approved. Its scores on an approved-loan test set look sound, while its behavior on the rest of the applicants is largely unmeasured.

Finding sampling bias takes a comparison between the data and the population the task will meet: which channels, regions, periods and exceptions are missing or thin. An evaluation set drawn the same way as the training data will not show the gap. Where important cases are under-represented or the distribution is skewed, DTS can fill in scarce cases and adjust the distribution for the task, and the before-and-after result is then checked on the same evaluation set, built to cover the cases the task will meet.

Frequently asked questions

What is an example of sampling bias in machine learning?

A model trained only on approved loans and then used to screen all applicants. Rejected applicants never produced repayment outcomes, so the model learned from a sample that leaves them out.

How do you reduce sampling bias?

Compare the data against the population the task will serve, add records from the missing channels, groups and periods, and build the evaluation set to cover them so the gap shows up in the scores.

Is sampling bias the same as algorithmic bias?

No. Sampling bias is a property of how the data was collected. Algorithmic bias refers to skewed or unfair outcomes from a system, which sampling bias can cause along with other factors such as labels and design choices.