What statistics do you need for machine learning?
Statistics is the study of drawing conclusions from data under uncertainty. Descriptive statistics summarize a dataset with numbers such as the mean and the standard deviation. Inferential statistics use a sample to estimate properties of the larger population it came from, and to measure how uncertain those estimates are.
Machine learning relies on both. Feature scaling uses means and standard deviations, batch normalization recomputes them for every mini-batch, and stochastic gradient descent treats each mini-batch gradient as a sample estimate of the full gradient. Standard errors and confidence intervals tell you whether a 0.5% accuracy gain on a test set is a real improvement or noise.
Key ideas
- The mean is the balance point of the data and minimizes the sum of squared deviations.
- Variance is the average squared deviation, and the standard deviation is its square root.
- A sample statistic estimates a population value and changes from one sample to the next.
- The central limit theorem says sample means are approximately normal for large n, given finite variance.
- The standard error of the mean is σ/√n.
- A 95% confidence interval comes from a procedure that captures the population value in 95% of repeated samples.
Common questions
What is the difference between standard deviation and standard error?
The standard deviation describes how spread out individual data points are. The standard error describes how much an estimate, such as the sample mean, would vary across repeated samples. For the mean, SE = σ/√n, so it shrinks as the sample grows while the standard deviation of the data does not.
How large does n need to be for the central limit theorem?
A common rule of thumb is n ≥ 30, but the real answer depends on the source distribution. Symmetric distributions like the uniform look normal after about 5 to 10 values. Strongly skewed data, such as incomes or response times, can need hundreds.
What is the difference between a parameter and a statistic?
A parameter is a fixed property of the population, such as its true mean μ, and is usually unknown. A statistic is computed from a sample, such as the sample mean x̄, and is used to estimate the parameter. Greek letters usually denote parameters and Latin letters statistics.
Why do ML papers report results over several random seeds?
Training involves random initialization, data shuffling and dropout, so one run gives one sample of a random outcome. Reporting the mean and standard deviation across seeds shows how much of a difference between methods is noise. A gap smaller than the seed-to-seed spread is weak evidence that one method is better.
Related explainers
- Probability & Distributions — Spam, densities, and the math of uncertainty
- Hypothesis Testing — Make principled decisions from data using null hypotheses, p-values, and significance levels
- Sampling & Monte Carlo — Random sampling, the law of large numbers, and Monte Carlo estimation
- Batch Normalization — Why normalizing activations speeds up deep network training
- Feature Scaling — Why and how to normalize features for faster convergence
- Epochs & Batching — How data is fed to the model in epochs, batches, and shuffles
References
- James, Witten, Hastie & Tibshirani, "An Introduction to Statistical Learning" (free online edition)
- Ioffe & Szegedy (2015), "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift"
- Goyal et al. (2017), "Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour"
Last updated