Statistics for Data Science

Descriptive statistics, sampling, confidence intervals, hypothesis tests and A/B testing to reason about data and model results honestly.

Beginner · about 14 hours · difficulty 3/5

Learn first: Probability for ML

Statistics separates real effects from noise. It tells you whether model B is actually better than model A and whether an observed pattern in data would survive a new sample.

Topics

  • Descriptive stats: mean, median, variance, quantiles, skew; correlation versus causation.
  • Sampling and the central limit theorem: why averages are approximately normal and how sample size affects precision.
  • Confidence intervals and the bootstrap: resample your test set to put error bars on a metric.
  • Hypothesis testing: null hypotheses, p-values, t-tests, chi-squared tests, and what a p-value does not mean.
  • Multiple comparisons: testing 50 features or 50 model variants inflates false discoveries.
  • A/B testing: randomization, power, minimum detectable effect; how models are validated in production.

Pitfalls

Reporting a single accuracy number with no uncertainty, p-hacking by trying many analyses until one is significant, and confusing statistical significance with practical importance.

Good enough to move on when you can bootstrap a 95% confidence interval for a model's F1 score and interpret whether two models differ meaningfully.

Key concepts

  • Descriptive statistics
  • Central limit theorem
  • Confidence intervals and bootstrap
  • Hypothesis tests and p-values
  • Multiple comparisons
  • A/B testing and power
  • Bayesian inference basics

Mini project

Train two classifiers on the UCI Adult income dataset and use bootstrap resampling of the test set to estimate confidence intervals for the accuracy difference between them.

Check yourself

What exactly does a p-value of 0.03 tell you, and what does it not tell you?

Free resources