Dictionary of Applied Machine Learning
Updated on 2026-09-07
Typeset PDF version — the authoritative form of this entry
Python demo — a script that recomputes what this entry states and prints one line per check
A random forest is an ensemble of decision trees. Each tree is trained on a bootstrap sample of the training set, and each split may choose only among a small random subset of the features. The predictions of the trees are aggregated by a majority vote in classification or by averaging in regression. The two sources of randomness decorrelate the trees, so that averaging reduces the variance of the aggregated prediction. Adding trees does not lead to overfitting: the generalization error converges to a limit that is bounded via the strength of the trees and the correlation between them. A random forest also yields a widely used form of feature importance, read off from the features its trees split on.
B-treesA bank must decide, for each loan
application, whether the applicant is creditworthy. A random
forest answers by asking many different decision trees
and following their majority: it is an ensemble of
decision trees, each trained on a bootstrap sample
of the training set (as in bootstrap aggregating (bagging)) and further
randomized by allowing each split to choose only among a small
random subset of the features (Breiman, 2001).
The predictions of the trees are aggregated by a
majority vote in classification or by averaging in
regression. Fig. 1 shows a
regression example: each data point is one day at
the weather station Krems, its feature the minimum and
its label the maximum air temperature of the day. Three
decision trees, each trained on its own bootstrap
sample of the days, yield three different piecewise
constant hypotheses; the random forest averages them.
pythondemos/randomforest.py
The two sources of randomness serve one purpose: they make the
trees less alike (Fig. 2). Averaging
reduces the variance of a
prediction most when the averaged predictions are
weakly correlated, and restricting each split to a random
subset of features prevents all trees from reusing the
same dominant features (Hastie et al., 2009, Sect. 15.2).
A random forest also reports which features its trees
split on most productively — a widely used form of
feature importance.
The averaging also yields stability: the learned hypothesis depends only weakly on any single data point of the training set. Consider the subbagged version of any machine learning (ML) method with predictions in $[0,1]$: each base learner is trained on a share $p$ of the $\samplesize$ data points, drawn without replacement, and the predictions are averaged over all such subsamples. Then, removing a single data point from the training set changes the prediction at a test point by more than $\varepsilon$ for at most a $\delta$-fraction of the removed data points, for every pair $(\varepsilon, \delta)$ with $\delta \varepsilon^{2} \geq \frac{1}{4(\samplesize-1)} \cdot \frac{p}{1-p}$ (Soloff et al., 2024, Thm. 8). This guarantee holds for every training set and requires nothing of the base learner beyond the bounded predictions — the stability is created by the averaging itself.
In the credit-scoring application, the majority vote over hundreds of trees is far less sensitive to a few unusual customer records than any single decision tree, and the feature importance readout indicates which applicant features drive the decisions.
See also: ensemble, bootstrap aggregating, decision tree, bootstrap, feature importance, variance, stability.
@misc{dictml_randomforest,
author = {Jung, Alexander and Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {random forest},
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-09-11},
url = {https://dictionaryofml.org/terms/randomforest.html}
}