Distributions, Bayes, and hypothesis testing
Go deeper into the statistical toolkit every ML practitioner reaches for: distributions, Bayes' rule, and the logic of hypothesis testing.
Before We Begin
We touched on probability in Foundations. Now we sharpen the tools. This lesson explores the distributions that show up everywhere in data—normal, Poisson, binomial—and teaches Bayes' rule as a formal method for updating beliefs with evidence. We finish with hypothesis testing: the scientific method's way of asking "is this result real or just luck?"
How this lesson fits
Theory is only half the story. In this module we roll up our sleeves and learn the craft behind every successful ML project: preparing data, engineering features, and strengthening our statistical intuition. These are the skills that separate a notebook experiment from a model you can actually trust.
The big question
What does raw, messy, real-world data need before a model can learn anything useful from it?
Why You Should Care
Every model evaluation, every A/B test, every confidence interval rests on these ideas. Students who internalize them will never be tricked by a lucky result or a misleading p-value. These are the critical-thinking tools of the data age.
Where this is used today
Think of it like this
Imagine you are a jury member. The prosecution presents evidence (data), and you start with some prior belief about guilt. Each new piece of evidence shifts your confidence up or down. At the end, you decide: is there enough evidence to reject "not guilty"? That is Bayesian reasoning meets hypothesis testing.
Easy mistake to make
A small p-value does not prove your hypothesis is true. It only says the result would be unlikely under the null hypothesis. Sample size, effect size, and context all matter just as much.
Think about this first
A medical test is 95% accurate. You test positive. Does that mean there is a 95% chance you are sick? Why might the real number be very different?
Words we will keep using
Every dataset has a shape. Understanding which distribution your data follows tells you what to expect, what counts as unusual, and which statistical tools apply.
The bell curve. Heights, test scores, measurement errors.
A medical test is 95% sensitive and 90% specific. The disease prevalence is 1%. If you test positive, what's the probability you actually have the disease? Most people guess ~90%. The real answer is shockingly different.
If you test positive, the real probability you have the disease is 8.8%. That's less than 50% \u2014 the prior was so low that even a good test can't overcome it!
The scientific method for data: start with a null hypothesis ("nothing is happening"), collect evidence, and ask: would this evidence be surprising if the null were true?