A binary classification population has positive-class proportion , and a fixed classifier has true error rates on positives and on negatives. How do the bias and variance of the validation error estimate compare between i.i.d. validation draws (simple random sampling) and stratified validation draws ( positives and negatives, assumed integers), and when does stratification reduce variance the most?
Foundations, Model selection
Level L4 Advanced. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can derive the exact variance reduction of stratified validation using the law of total variance and interpret it for imbalanced classification.
Key idea
Both simple random and stratified validation are unbiased for the true error , but stratification removes the between-class variance term caused by random fluctuations in the validation class ratio.
Steps
- Define the population error and both estimators: let be the 0–1 error indicator of the fixed classifier, with and . The true population error is
- Analyse simple random sampling (SRS): for i.i.d. draws from . It is unbiased () with variance . Apply the law of total variance conditioning on : because takes values with probability and with probability .
- Analyse stratified sampling: draw positives and negatives independently, compute class error rates and , and form (which equals the overall average ). It is also unbiased: .
- Compute the stratified variance using independence between the two class strata:
- Take the difference:
- Interpret: stratification never increases variance (for proportional allocation) and achieves the largest absolute variance reduction when both and are large (under strong class imbalance with small and , the share of the variance it removes is only about , so it matters most when the positive-class error is large). In -fold CV, stratified folds keep every fold's class ratio near , preventing unlucky folds with almost no positive examples.
Common mistakes
- Forgetting the or squaring when computing .
- Thinking stratification fixes *biased* sampling or changes the expected value when classes are reweighted without restoring the true prior : equal-count () validation without reweighting by and estimates instead of .
How long your answer should be
One page; 8–10 minutes.
Last checked on 4 December 2026.
Read this
Previous in Foundations: Suppose you use a train/validation/test split to choose among candidate models (with 0–1 loss) on a validation set of size . Using Hoeffding's inequality and the union bound, how large must be so that simultaneously all validation errors are within of their true errors with probability at least , why do large datasets not need 20\% validation splits, and should you retrain on train+validation before testing?
Next in Foundations: How is Schwarz's Bayesian Information Criterion derived from the Bayesian marginal likelihood using Laplace's approximation?