Dictionary of Applied Machine Learning: 107 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here
Updated on 2026-10-22
Readiness 100/100
See also bagging boosting random forest variance
An ensemble method combines several machine learning (ML) methods, each referred to as a base learner. Ensemble methods differ in how they construct the base learners and in how they combine their results. Bagging trains each base learner on a resampled copy of the training set. Boosting runs them sequentially, each one fitted to the errors of the previous ones. Stacking uses base learners to train different models on the same training set and learns an aggregation rule. For the squared error loss the gain is exact: the error of the average prediction is the average error of the base learners minus their average disagreement, so base learners that disagree are what makes an ensemble worth forming.

ensemble.py, which recomputes what the entry states: the script block by block · open in ColabB-combinePredicting the maximum temperature of a
day at the weather station Krems an der Donau from the minimum
temperature of the same day can be done with a linear model, with
a decision tree, or with an artificial neural network (ANN).
Fig. 1 shows all three learned from the
$366$ days of $2020$. None of them is the best everywhere: the
linear hypothesis is too stiff at the cold end, the decision tree
answers with a staircase, and the ANN bends where the other
two cannot. Model selection would keep one of them and discard the
rest. Is there a better way to combine these base learners
instead of choosing one of them?
pythondemos/ensemble.py
B-varThe same point in terms of variance: consider $\numlearners$ base learners whose predictions are identically distributed, each with variance $\sigma^{2}$ and pairwise correlation $\rho$. The average of these predictions has variance (Hastie et al., 2009, Sect. 15.2) \[\rho \sigma^{2} + \frac{1-\rho}{\numlearners}\,\sigma^{2}\text{.}\] The second of these two summands vanishes as $\numlearners$ grows, while the first, set by the correlation between the base learners, limits what averaging can achieve.
Ensemble methods differ in how they construct the base learners and in how they combine their results. Bagging trains each base learner on a random resample of the training set and averages them; it reduces the variance of an unstable base learner such as a deep decision tree, while the systematic part of its error, the bias, is left unchanged (Hastie et al., 2009, Sect. 8.7). A random forest is bagging of decision trees with, in addition, a random choice of the features considered at each split, which lowers the correlation between the trees (Breiman, 2001, Sect. 2.2).
Boosting runs the base learners sequentially, each one fitted to the errors of the previous ones. The number of rounds is a hyperparameter: the training error keeps decreasing while the validation error eventually rises, so boosting overfits when run for too long (Hastie et al., 2009, Sect. 10.12). Stacking trains the base learners on the same training set with different models and learns the aggregation rule itself by a second ML method. The second method is trained on predictions for data points the base learners did not see. Otherwise the base learners that fit the training set best are favored regardless of how they generalize (Hastie et al., 2009, Sect. 8.8).
See also: bagging, boosting, stacking, base learner, random forest, variance, correlation.
@misc{dictml_ensemble,
author = {Jung, Alexander},
editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {ensemble},
howpublished = {Dictionary of Applied Machine Learning (course edition)},
year = {2026},
doi = {10.5281/zenodo.21569296},
note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-10-27},
url = {https://dictionaryofml.org/terms/ensemble.html}
}