| Statistic | Value |
|---|---|
| Number of pairs | 1078 |
| Father mean height | 67.7 inches |
| Son mean height | 68.7 inches |
EDA for Machine Learning
John Tukey (1977): Statisticians had become too focused on formal inference at the expense of simply looking at data.
EDA is the corrective:
| Confirmatory | Exploratory |
|---|---|
| Begins with a hypothesis | Begins with data |
| Asks: do data support or refute? | Asks: what patterns are present? |
| Tests pre-specified claims | Generates new hypotheses |
A complete analysis typically involves both.
A willingness to look at data from multiple angles, to transform variables, to compare subgroups, and above all to ask questions.
Population
The complete set of cases we care about
Sample
The subset we actually observe
Mean (Average)
\[\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i\]
Median
Middle value when sorted
Standard Deviation
\[s = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2}\]
Interquartile Range (IQR)
\[\text{IQR} = Q_3 - Q_1\]
Key insight: Compute both and compare.
Large discrepancy between mean and median signals:
→ Warrants further investigation
Standard starting questions:
Domain-specific questions arise from context and purpose.
| Stage | EDA Role |
|---|---|
| Before | Understand distributions, detect quality issues |
| During | Compare models, identify difficult cases |
| After | Examine residuals, check assumptions |
Francis Galton (1885): Investigated whether height is hereditary
Karl Pearson: Founded first statistics department (UCL, 1911); collected father-son height data
This data set introduced:
| Statistic | Value |
|---|---|
| Number of pairs | 1078 |
| Father mean height | 67.7 inches |
| Son mean height | 68.7 inches |
Figure 1: Heights of father-son pairs
One visualization → one question answered, new questions raised
Figure 2: Son’s height by father’s height interval
This shows the conditional distribution of son’s height given father’s height.
→ Central concept in Chapter 2
Figure 3: Comparing height distributions
| Generation | n | Mean | Median | SD |
|---|---|---|---|---|
| father | 1078 | 67.7 | 67.8 | 2.7 |
| son | 1078 | 68.7 | 68.6 | 2.8 |
Sons are about one inch taller on average.
Figure 4: Distribution of son’s height minus father’s height
Galton’s observation:
Extremely tall fathers tend to have sons who are tall, but not quite as extreme.
This is a statistical phenomenon, not a genetic one.
It arises whenever two variables are correlated but not perfectly so.
→ Explored mathematically in Chapter 2
Throughout this book, code is generally hidden.
This framework (ggplot2) provides flexibility for constructing visualizations.
Diamond Data (ggplot2::diamonds)
General Social Survey (forcats::gss_cat)
| Chapter | Topic |
|---|---|
| 2 | Conditional Distributions |
| 3 | Clustering |
| 4 | Statistical Simulation |
| 5 | Sampling and Study Design |
| 6 | Information Theory |
Look at the data, ask questions, and let the data guide your understanding.
This mindset remains central throughout the book.
For the father-son height data:
Galton observed that extremely tall or short fathers tend to have sons who are not quite so extreme.
A colleague says “I have 10 million rows—I don’t need to look at the data.” How would you respond?
When might prediction and understanding conflict? Give an example.
What would Tukey think about large language models doing data analysis?