AI Glossary

Random forest

A random forest combines predictions from many randomized decision trees. In the standard design, trees train on bootstrap samples of rows and consider random subsets of features at each split, then aggregate their predictions.

· Updated · Chain of Thought

A churn classifier could train many decision trees on different resampled customer rows. At each split, each tree considers only a random selection of features. These choices encourage differences among trees so aggregation can reduce the variance of relying on one tree.

Aggregation depends on the implementation. Breiman’s original classifier uses votes; scikit-learn averages class probabilities. For example, three trees giving churn probabilities 0.8, 0.6 and 0.1 produce an average of 0.5. A chosen threshold of 0.6 would label that customer non-churn. These numbers illustrate arithmetic, not measured or necessarily calibrated probabilities.

Trees can train independently, unlike gradient boosting, which adds learners in stages. A forest can capture nonlinear relationships, but it still needs held-out evaluation. Feature importance is a model-dependent diagnostic, not proof that a feature causes churn.

Different trees, one combined predictionThree randomized trees receive different bootstrap samples, shown as excerpts, and random feature candidates at splits. Their churn probabilities are 0.8, 0.6 and 0.1. Averaging gives 0.5; at a chosen threshold of 0.6 the final label is non-churn. Different trees, one combined predictionIllustrative probability averaging, as used by scikit-learn Training rows → resample for each tree; vary feature candidates at each splitTree 1Rows: A, B, A, D, ...Random split candidatesP(churn) = 0.8Tree 2Rows: C, A, D, C, ...Random split candidatesP(churn) = 0.6Tree 3Rows: B, B, C, D, ...Random split candidatesP(churn) = 0.1Mean = (0.8 + 0.6 + 0.1) / 3 = 0.5Chosen threshold 0.6: 0.5 is below it → predict non-churn.
A teaching example of scikit-learn’s probability averaging. Breiman’s original classifier uses class votes. Bootstrap samples are excerpted; the letters, probabilities and threshold are illustrative. Download the image

Sources

Go deeper