Ensembles & Stacking
Q: Why do ensembles work, and what is stacking?
Averaging models with uncorrelated errors reduces variance (Var(mean) = ρσ² + (1−ρ)σ²/M). Techniques:
- Bagging (bootstrap + average: random forest), boosting (sequential bias reduction: GBDT), snapshot/seed ensembles for neural nets.
- Stacking: train a meta-model on out-of-fold predictions of base models (never in-fold → leakage).
- Costs: latency and complexity at serving time → often distill the ensemble into one model.