# Ensemble learning

> Canonical: https://skillalmanac.com/glossary/ensemble-learning | Last verified: 2026-11-25 | Index status: index-eligible

Ensemble learning combines the predictions of several models, often called base estimators, into one prediction, aiming to improve generalizability or robustness compared with a single model.

Also called: ensemble methods, ensemble model, ensemble machine learning, ensemble models, ensembling.

## In plain language

Ask one person to guess how many sweets are in a jar and you may be far off. Ask many people and combine the guesses, and the result is often closer. Ensemble learning does this with models: several are trained and their answers are combined, for example by averaging or voting. The extra models cost more time and memory, and the combined result is harder to explain. It also helps less if the models make the same mistakes.

## Technical definition

The scikit-learn user guide defines ensemble methods as combining the predictions of several base estimators built with a given learning algorithm to improve generalizability or robustness over a single estimator. It groups averaging methods such as bagging, which fits estimators on random subsets of the training set and aggregates their predictions, with boosting, which fits a sequence of weak learners on repeatedly modified data and combines them by weighted vote or sum. IBM adds stacking, where a meta-learner is trained on base learners' predictions.

## How it shows up when you use agents

Ensemble learning is a classic machine-learning technique, so you meet it when an agent writes data-science code, for example using scikit-learn's random forest or gradient boosting classes, which the user guide lists among its ensemble methods. A coding agent may also describe a pipeline that averages several models.

The term is sometimes used loosely for any setup that combines several models or several model calls. The sources here describe the machine-learning technique: base estimators combined into one prediction. Whether a particular agent design counts is a judgement, so ask what is being combined and how.

What breaks when it is misunderstood: a reader assumes more models means better results. IBM notes that benefits depend on the diversity of the component models and stacking needs careful construction. Reusing in-sample base predictions to fit the combiner risks overfitting; using cross-validated predictions from the same original dataset is different, as scikit-learn's default StackingClassifier demonstrates. Ensembles can also suffer unfairness, per IBM.

Next action: when an agent proposes an ensemble, ask for the single-model baseline on the same held-out data first. See [random forest](/glossary/random-forest) and [gradient boosting](/glossary/gradient-boosting) for two named methods, and [overfitting](/glossary/overfitting) for the main risk.

## Common confusions

- **Bagging versus boosting.** Bagging fits estimators on random subsets and aggregates them, to reduce variance, per scikit-learn. Boosting fits learners in sequence. AdaBoost-style methods reweight examples; gradient boosting fits loss gradients rather than following one universal missed-example rule.
- **Ensemble versus mixture of experts.** An ensemble combines base predictions; training may be independent as in bagging or sequential as in boosting. [Mixture of experts](/glossary/mixture-of-experts) is a neural-network design with its own routing; see its page.
- **Ensemble versus a single large model.** Combining models is not the same as making one model larger.
- **Myth.** An ensemble is more accurate than one model by default. The sources say it aims to improve generalizability or robustness, and results depend on the component models.

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill checks train, validation and test files for duplicates, shared groups, time and label leakage and prints JSON.

Why it exercises the concept: Stacking can overfit when its combiner learns from in-sample base-model predictions. Scikit-learn normally uses out-of-fold predictions for the combiner, even on the same original dataset. This split-file checker flags selected data overlaps; it does not inspect the fitted stacking procedure.

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill is a fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.

Why it exercises the concept: Profiling a dataset before choosing models is a typical first step. It does not build an ensemble.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill builds and validates an eval dataset for any LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: Judging whether a combined system beats a single one needs a held-out test set. This skill helps build one for LLM features; it does not combine models.

## Related terms

- [Random forest](https://skillalmanac.com/glossary/random-forest.md)
- [Gradient boosting](https://skillalmanac.com/glossary/gradient-boosting.md)
- [Decision tree](https://skillalmanac.com/glossary/decision-tree.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Overfitting](https://skillalmanac.com/glossary/overfitting.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)

## Sources

- [Ensembles: Gradient boosting, random forests, bagging, voting, stacking (scikit-learn user guide)](https://scikit-learn.org/stable/modules/ensemble.html), scikit-learn (accessed 2026-11-24)
- [What is ensemble learning?](https://www.ibm.com/think/topics/ensemble-learning), IBM (accessed 2026-11-24)
- [StackingClassifier: cross-validated predictions and prefit warning](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.StackingClassifier.html), scikit-learn (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
