Skip to main content
Home › Categories › Artificial Intelligence & Computing › Ensemble Learning: Bagging, Boosting, Stacking, and Model Blending

Ensemble Learning: Bagging, Boosting, Stacking, and Model Blending

Author: ZUVDEX Team 4 min read
ensemble learning bagging boosting stacking condorcet jury theorem variance reduction stacked generalization out of fold autogluon multi layer ensembling model soup weight averaging diversity vs individual accuracy

Ensemble learning combines predictions from multiple distinct models so uncorrelated individual errors cancel out, yielding generalization accuracy and calibration consistently superior to the single best constituent model. Grounded in bias-variance decomposition and Bayesian model averaging, ensemble methods fall into three structural paradigms: parallel Bagging (variance reduction), sequential Boosting (bias reduction), and heterogeneous Out-of-Fold Stacking (combining structurally diverse model families such as XGBoost, CatBoost, LightGBM, regularized GLMs, and tabular neural networks).

Key Highlights

  • Averaging M models with equal error variance σ² and pairwise error correlation ρ yields ensemble variance ρσ² + ((1 − ρ)/M)σ²—proving mathematically that model diversity (low ρ) matters as much as raw count M.
  • Combining five differently seeded XGBoost models gives modest gains (high ρ), whereas blending XGBoost + CatBoost + Ridge/Logistic + Tabular MLP/RealMLP delivers substantial gains because their error geometries differ.
  • David Wolpert’s Stacked Generalization MUST train the meta-learner strictly on Out-of-Fold (OOF) cross-validation predictions—fitting a meta-learner on in-sample training predictions leaks memorization.
  • When 15-millisecond serving SLAs forbid running ten ensemble models online, teams distill the offline stacked ensemble’s soft predictions into a single fast production GBDT or compact neural net.

Error Decorrelation and Leak-Free Out-of-Fold Stacking

Suppose a deep neural network achieves 91% accuracy and a gradient-boosted tree achieves 91.5% accuracy on a credit table. If both models misclassify the exact same rows, averaging helps little; in practice, smooth neural manifolds and axis-aligned tree splits disagree on boundary edge cases, so a weighted convex combination routinely jumps past both models while improving log-loss calibration.

To avoid leakage in Stacked Generalization, K-fold cross-validation generates strictly out-of-fold predictions for every training row across each base learner; a heavily regularized meta-learner (typically non-negative Ridge, Logistic Regression, or Caruana greedy ensemble selection) learns optimal combination weights over those OOF columns.

Ensemble Strategy Primary Error Reduced Training / Serving Cost Best Production Use Case
Bagging / Subagging High Variance N× parallel fit & serve Stabilizing deep trees or noisy small-sample regressors
Gradient Boosting High Bias Sequential trees; fast C++ inference Single-model tabular production workhorse
Out-of-Fold Stacking Both Bias & Family Blind Spots Multi-family K-fold fit; heavier serving Batch credit/churn scoring, Kaggle-grade accuracy & AutoML
Model Soups / SWA Checkpoint Variance averages weights into 1 checkpoint (1× inference!) Zero-extra-latency accuracy boost on fine-tuned ViTs & LLMs

Greedy Ensemble Selection, Model Soups, and Serving Economics

Rich Caruana’s greedy forward ensemble selection (used at the core of AutoGluon) iteratively adds with replacement whichever OOF model improves validation metric most, naturally producing sparse non-negative weights immune to meta-learner overfitting. Meanwhile, Mitchell Wortsman’s "Model Soups" averages the parameter tensors themselves across checkpoints fine-tuned from the same pretrained initialization—capturing ensemble accuracy gains inside one single model at zero additional inference latency.

  • Constrain stacking meta-learners to simple non-negative linear/convex combinations—complex tree meta-learners easily overfit correlated OOF columns.
  • Use identical K-fold row indices across every base model in a stack; mismatched folds leak target information across layers.
  • Quantify exact marginal ROI before deploying a 6-model live stack—often a 2-model blend (CatBoost + RealMLP) captures 90% of the gain of a 20-model stack.

References & Sources

  • Wolpert, David H. (1992) — Stacked Generalization, Neural Networks, 5(2), 241–259.
  • Erickson, Nick et al. (2020) — AutoGluon-Tabular: Robust and Accurate AutoML for Structured Data, arXiv:2003.06505.
  • Wortsman, Mitchell et al. (2022) — Model Soups: Averaging Weights of Multiple Fine-Tuned Models Improves Accuracy without Increasing Inference Time, ICML.