Actuarial Notes

Random Forest

Study guides: Exam SRM, Exam PA, Exam MAS-II, Exam ACIA-CAPSTONE

A Random Forest is a set of decision trees grown as in bagging, on bootstrap samples, except that each split may use only a random subset of m of the p predictors. The typical number of predictors per split is

m \approx \sqrt{p} \text{ for classification}

m \approx p/3 \text{ for regression}

A fresh random sample of m predictors is drawn at every split of every tree, not once per tree, and the m are drawn without replacement, so exactly m distinct predictors are considered. A random forest with m = p is bagging, so bagging is the special case of a random forest that considers every predictor at each split.

A fraud classifier has p = 36 predictors, one far stronger than the rest. What m is a starting point, and what happens at m = 36?

  • For classification, m = \sqrt{36} = 6.
  • At m = 36 the forest is bagging: the strong predictor is available at every split, so it is chosen at the top of nearly every tree and the trees are near-copies.

Decorrelating the trees

Restricting each split to a random subset of predictors keeps a dominant predictor out of many splits, so the other predictors show through and the trees are less alike. Decorrelated trees have a smaller correlation \rho in the variance of an average, so averaging them reduces the variance more than bagging does. This makes random forests an improvement over bagging, especially with many correlated predictors.

A smaller m decorrelates the trees more but weakens each tree. m can be chosen by out-of-bag error. As in bagging, adding trees does not cause overfitting.

Bagged trees have \sigma^2 = 1 and \rho = 0.6. A random forest's trees have \sigma^2 = 1.2 and \rho = 0.3. With 500 trees, which average has the smaller variance?

  • Bagging gives 0.6(1) + 0.4(1)/500 = 0.601.
  • The random forest gives 0.3(1.2) + 0.7(1.2)/500 = 0.362.
  • The forest's average has the smaller variance, though each of its trees varies more.

A new subset at every split The m predictors are not chosen once for each tree. A new subset is drawn at every split, so one tree can use all p predictors across its splits.

Practice questions

Actuarial Notes