liveBook · Manning

Selection bias

As explained in Deep Learning with Python, Third Edition

A bias introduced when the data collection process produces a sample that is not representative of the target population.

Selection bias, also called sampling bias, appears when the data-collection process produces measurements that do not represent the target population. The problem is especially dangerous when who gets sampled is related to what you are trying to predict. section 6.1.2

The 1948 election poll

A phone survey suggested that Dewey would win the 1948 US presidential election, prompting the Chicago Tribune’s “DEWEY DEFEATS TRUMAN” headline. Phone users were not a random sample: they were more likely to be richer, conservative, and likely to vote for Dewey. The survey therefore measured a systematically skewed slice of voters. section 6.1.2

Practical rules of thumb:

  • Check whether the collection process changes who appears in the dataset or how outcomes are measured. section 6.1.2
  • Treat predictions from past data cautiously when the sample or the underlying behavior may change. section 6.1.2
“DEWEY DEFEATS TRUMAN”: a famous example of sampling bias
dewey truman

Use the historical polling example to see how an apparently ordinary collection method can produce a systematically misleading sample. section 6.1.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines the mechanism and works through a historical polling example, but does not detail correction methods.
Examples
Uses the 1948 US election phone survey and the “DEWEY DEFEATS TRUMAN” headline.
What you can do after
Evaluate whether a collection process produces a representative sample before trusting its predictions.
How it connects
Connects sampling bias with data collection, machine learning, prediction, and concept drift.

Also explained in

Compare how 4 books explain selection bias →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.