Bayesian vs. Frequentist Statistics
Two answers to 'what is a probability?'
Every statistical method you use — a confidence interval, a p-value, a regularization term, a Naive Bayes classifier — rests on an implicit answer to a deceptively simple question: what does a probability actually mean?
The frequentist answer: probability is the long-run frequency of an event across infinitely many repeated trials. Saying a coin has a 50% chance of heads means that if you flipped it forever, heads would show up half the time. Parameters (like a population mean) are treated as fixed, unknown constants — not random — and it's the data that's random.
The Bayesian answer: probability is a degree of belief, updated as evidence arrives. Parameters themselves can have probability distributions representing your uncertainty about them. Saying a coin has a 50% chance of heads can mean you have no information to favor either side — a statement about your knowledge, not a claim about infinite repetition.
Note
The frequentist toolkit: p-values and confidence intervals
Frequentist inference asks: 'if the null hypothesis were true, how surprising is this data?' A p-value is the probability of observing data at least as extreme as what you saw, assuming the null hypothesis is true. It is not the probability that the null hypothesis is true — a common and consequential misreading.
A 95% confidence interval means: if you repeated this sampling process many times and built an interval the same way each time, 95% of those intervals would contain the true parameter. It does not mean there's a 95% probability the true value lies in this particular interval — the frequentist framework forbids assigning a probability to a fixed, unknown parameter at all.
The Bayesian toolkit: priors, likelihoods, posteriors
Bayesian inference starts with a prior — your belief about a parameter before seeing data — and updates it using Bayes' theorem once data arrives, producing a posterior distribution:
posterior ∝ likelihood × prior
The likelihood captures how well different parameter values explain the observed data; the prior captures what you believed beforehand; the posterior is the synthesis. Crucially, the posterior is a full probability distribution over the parameter — so you genuinely can say 'there's a 95% probability the true conversion rate is between 0.31 and 0.38,' because in the Bayesian framework the parameter itself is treated as a random variable with a distribution.
Note
Frequentist vs. Bayesian, side by side
| Aspect | Frequentist | Bayesian |
|---|---|---|
| What probability means | Long-run frequency over repeated trials | Degree of belief, updatable with evidence |
| Parameters | Fixed, unknown constants | Random variables with distributions |
| Needs a prior? | No | Yes — explicit and must be justified |
| Key output | p-value, confidence interval | Posterior distribution, credible interval |
| Small-sample behavior | Can be unstable or undefined | Prior regularizes estimates naturally |
| Common ML examples | t-tests, A/B test significance, standard regularized MLE | Naive Bayes, Bayesian optimization, Bayesian neural nets, Thompson sampling |
Where this shows up constantly in ML, whether you notice or not
L2 regularization (ridge regression, weight decay) is mathematically equivalent to placing a Gaussian prior on model weights and finding the posterior mode — a Bayesian idea hiding inside a frequentist-looking optimization. Naive Bayes classifiers compute an actual posterior over class labels given features. Bayesian optimization (used for hyperparameter tuning) maintains a posterior distribution over an unknown function to decide where to sample next. A/B testing tools built around p-values are frequentist; tools built around 'probability variant B is better' are Bayesian — same underlying data, different inferential philosophy, and sometimes different practical conclusions.
Note
What's next
Both frameworks are tools for quantifying uncertainty, and you'll use both throughout an ML career — frequentist tests for most A/B testing and model comparisons, Bayesian methods for hyperparameter search and anywhere you want to incorporate prior knowledge directly. The next lesson, Confidence Intervals for ML Metrics, goes deeper on the frequentist side: how to actually put rigorous uncertainty bounds around the model metrics you report.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.