All lessons in Machine Learning Engineering: Reliable Predictive Models

Random Forests and Correlated Trees

Explain feature subsampling and tune forest capacity under a fixed evaluation protocol.

30 minutes · Members lesson · preview

What you will learn

  • Compute the variance of an averaged ensemble from a tree-correlation fixture and explain why extra trees cannot push it below the correlated part.
  • Explain how bootstrap rows and per-split feature subsampling decorrelate trees, and compute inclusion probabilities for both mechanisms.
  • Tune n_estimators, max_features and leaf size by validation log loss under a fixed split while keeping the final test sealed, and convert an averaged forest probability into a dispatch decision with a cost threshold.

A single deep decision tree fitted to the parcel carrier's dispatch records is a nervous forecaster. Move a few late parcels in or out of the training set and the root split can flip from dispatch_load to weather_risk, reshaping every branch underneath. Bagging calms some of that nervousness by fitting many trees on bootstrap resamples and averaging them. A random forest goes one step further: at every split, each tree may only look at a random subset of the features. This lesson explains why that second trick matters, how a forest turns many tree outputs into one probability of a late delivery, and how to tune the forest's capacity without quietly tuning on the data you promised to keep sealed.

Choose another lesson