TL;DR
A Random Forest predicts by averaging many randomised trees, each grown on a bootstrap sample of the data, and each allowed to split on only a random subset of the features. Leo Breiman introduced it in 2001, and it remains one of the most reliable general-purpose predictors. Its theory has lagged its practice, because bagging and the CART split rule are hard to analyse together.
The survey by Gérard Biau and Erwan Scornet is a guided tour of that theory. It describes Breiman's algorithm in full, then studies simplified forests that can be analysed. For each one it states what is proved: consistency, rates of convergence, and the link to nearest-neighbour averages. Consistency is defined in Statistical Consistency.
Where you'll see it: tabular prediction problems with many features and modest sample sizes, variable importance rankings in applied statistics, and as a strong baseline in machine learning competitions.
The problem
Modern datasets can be large, with many features, and a predictor must scale with them while remaining statistically efficient. Random forests meet both needs in practice. They handle many features, need little tuning, and parallelise easily. Breiman's 2001 paper gave the best-known theoretical result, an upper bound on the generalisation error in terms of how strong each tree is and how correlated the trees are.
The gap is that the algorithm is a combination of several interacting parts. It resamples the data, it picks features at random, it grows trees by a greedy split rule, and it averages the trees. Each part is simple, but the whole is hard to analyse. As a result, most theory studies a stripped-down version, and it has been unclear how far the results carry over to the real algorithm. The survey's job is to lay out what each theoretical approach proves and what it leaves out.
Key idea
A forest is an average of trees, and each tree is a local averager. A tree splits the input space into boxes, and predicts by averaging the responses of the training points that fall in the same box as the query. Each tree is therefore a nearest-neighbour style estimate with its own shape of neighbourhood. Averaging many such trees, each built on different random data and features, smooths out the erratic edges of any single tree. The forest's bias is roughly that of a deep tree, and its variance is pushed down by averaging.
The survey's central observation is that the randomness does two jobs. Resampling makes trees differ, and feature selection decorrelates them. Both reduce the variance of the average, but both also change the bias, so the theory has to track each one.
The method
The forest estimate
Write the training sample as , where each is a vector of features and each is a real response. The goal is to estimate the regression function , the Conditional Expectation of the response given the features. This is the best prediction under squared error, as the survey notes.
Each tree uses an independent random variable that controls both the resampling and the feature choices. The tree's prediction at is
Here is the set of resampled points, is the cell of the tree that contains , and counts the resampled points in that cell. The indicator equals one when the condition holds and zero otherwise. So the tree averages the responses of the points that share its cell with .
The forest averages trees:
Letting grow without limit gives the infinite forest, which averages over itself. The law of large numbers justifies this step: the finite forest converges to the infinite one as grows, given the data. The R package randomForest uses trees by default.
Breiman's algorithm
The survey gives three parameters and the default values in the R package for regression.
- , the number of points drawn for each tree. The default is , drawn with replacement, which is bootstrap sampling. Bagging is this same idea applied to any model.
- , the number of features considered at each split. Each split picks features at random and searches only those. The default is for regression.
- , the size below which a cell is not split. The default is 5 for regression. Trees are not pruned.
At each cell, the tree tries every cut position on the chosen features and keeps the best one. The split score is the CART criterion of Breiman and colleagues. It measures the drop in variance of the response caused by the cut. The survey points out that this is the one part of the algorithm the theory has trouble with, because the best cut depends on the data in a way that resists analysis.
Out-of-bag error
Each bootstrap sample leaves some points out. Those points were not used to grow that tree, so they form a test set for it. Averaging each point's prediction over only the trees that did not see it gives the out-of-bag error. It is a built-in estimate of test error that needs no validation split, which is why the default parameters can be checked without holding data back.
Consistency
The survey judges a regression estimate by whether it is consistent: its mean squared error goes to zero as grows. Breiman's forest is hard to analyse, so the theory is built on simpler models. The first is the centred forest. Each node picks a coordinate uniformly at random and splits the cell at its midpoint. The tree is grown to levels, so each leaf holds about points when the features are uniform. Averaging the responses in the leaf of gives the estimate.
The survey cites results from Breiman (2004), Biau and colleagues (2008), and Scornet (2015) showing that the centred forest is consistent provided
The first condition says the trees get finer, so the bias goes away. The second says each leaf keeps growing, so the average in each leaf becomes accurate. Both are needed. The natural choice , which matches Breiman's advice not to prune, breaks the second condition, and the survey says so plainly.
Forests as nearest-neighbour averages
Some points in the training set are "layered nearest neighbours" of if the box spanned by and that point contains no other training point. If each leaf holds only one point and the trees ignore resampling, the forest estimate is a weighted average of the responses of the layered nearest neighbours of , with weights that sum to one. Lin and Jeon (2006) pointed out this link. Under uniform features on a -dimensional cube, they show that the mean squared error of such estimates cannot shrink faster than order , where is the largest number of points in a leaf. The factor is why such averages converge slowly in many dimensions. The exact weights of Breiman's own forest are unknown, so this connection gives a route to analysis rather than a full theory.
Results
The survey has no experiments of its own. Its results are theorems about simplified forests, and the paper states each with its assumptions.
- Centred forests, sparse signal. If only of the features matter, and the forest splits on each relevant feature with probability about , then under a Lipschitz smoothness condition the squared error of the infinite forest is of order . The rate depends on , not on . The survey notes this is faster than the usual whenever . The result assumes the forest finds the relevant features, which is a strong assumption.
- Purely uniform forests, one feature. For , the error of this model is of order under a Lipschitz assumption. The survey notes this matches the best possible rate over Lipschitz functions, so no estimator can do better in that class.
- Variance reduction. The survey explains that a single fully grown tree has high variance, and that averaging many randomised trees lowers it. For simplified forests this shows up as better rates than a single tree gets. The survey flags that the picture for Breiman's own forest is still incomplete.
The survey's main message from these results is that the forest's advantage over a single tree is mostly in the estimation error, while the approximation error comes from the tree's shape and is harder to reduce.
Why it mattered
Breiman's forests became a default method in applied statistics, in machine learning and in competitions. The survey documents their use in air-quality prediction, chemoinformatics, ecology, object recognition and bioinformatics. Its authors cite claims that ensembles of trees have been among the most successful general-purpose methods in practice, and they contrast this with how little is known about the mathematics.
The survey's value is in organising the theory. It separates what is proven for simplified forests from what is observed for the real algorithm, and it shows how each simplification changes the analysis. That map is what later theory work has built on.
Reading guide
Read the survey roughly in this order, with these prerequisites in hand. Section names are descriptive, so match them to the survey's headings.
- Introduction. Needs Random Forest and Ensemble Learning for the idea of averaging predictors, and Overfitting for why averaging helps.
- Basic principles of the forest estimate. Needs Conditional Expectation for the regression function, and Law of Large Numbers for the step to an infinite forest.
- Breiman's algorithm. Needs Bootstrap Sampling and Bagging for the resampling, and Decision Tree for cells and splits. Work the split criterion slowly.
- Classification. Needs Entropy only as background. The survey uses the Gini impurity here, which is the classification counterpart of the variance criterion.
- Parameter tuning. Needs Bias-Variance Tradeoff to see why more trees cannot overfit, and Overfitting for the out-of-bag estimate.
- Simplified models and consistency. Needs Statistical Consistency and Smooth Function for the Lipschitz condition. Read the centred-forest consistency result first.
- Forests and neighbours. Needs Local Linear Regression as a comparison point for local averaging. Read it for the link to nearest-neighbour estimates.
- Theory for Breiman's own forest. This covers the resampling and the splitting criterion, and builds on the simplified models, so read it last.
Check yourself
QuestionWhy does a random forest use random feature subsets at each split, in addition to resampling the data?Show answer
QuestionCompute the CART-style gain for a split. A node has 6 points with response class 1 and 4 with class 0. The split sends 5 points left, containing 4 of class 1 and 1 of class 0, and 5 points right, containing 2 of class 1 and 3 of class 0. What is the gain using p0 times p1?Show answer
QuestionA forest of M trees has tree prediction variance sigma squared equal to 4 and pairwise correlation rho. What is the forest variance when rho is 0.25 and M is 100?Show answer
QuestionWhy does the choice k equal log n, which matches Breiman's advice not to prune, fail the survey's consistency condition for centred forests?Show answer
QuestionA bootstrap sample of size n is drawn with replacement. For large n, about what fraction of points are left out, and why does this matter?Show answer
Sources
- Biau and Scornet, "A Random Forest Guided Tour," arXiv 2015, published in TEST 2016: arxiv.org/abs/1511.05741
- "Random forest," Wikipedia: en.wikipedia.org/wiki/Random_forest