A random forest combines many randomized decision trees into one prediction. Each tree sees a different sample of training cases and a changing set of candidate features at every split, producing diverse predictions that are aggregated for greater reliability. section 5.1.2 section 5.6
The main design choices create a practical bias–variance trade-off:
- Bootstrapping gives trees slightly different training samples, while feature sampling creates different tree structures and less-correlated predictions. section 5.1.2
- Binary classification uses majority voting: the most frequent tree prediction becomes the forest’s class prediction. section 5.1.2
- Useful tuning controls include the number of trees, maximum features per split, maximum tree depth, and minimum terminal-branch size. section 5.6
- More trees can improve reliability but increase computation; forests can also estimate feature importance and case similarity. section 5.6
A tabular classification workflow
A scikit-learn pipeline can one-hot encode categorical columns, pass through continuous columns, and fit a RandomForestClassifier with 300 trees, a minimum leaf size of 3, shuffled five-fold cross-validation, and a fixed random state. The same family of randomized trees can serve as a RandomForestRegressor inside IterativeImputer for multivariate missing-value estimation; deeper or larger forests improve estimates at additional computational cost. section 5.1.2 section 6.1.1
Figure 5.4 How random forests arrives at its results by combining the different data partitioning due to its decision trees thanks to majority voting
Visualizes how different tree partitions combine through majority voting into a final classification. section 5.1.2










