Actuarial Notes

Variable Importance

Study guides: ATPA, Exam MAS-II

Variable Importance is a measure of how much a predictor contributes to a tree ensemble, which recovers some of the interpretability that one decision tree has and hundreds of trees do not. The importance of predictor X_j in a bagged model of B trees is

\mathrm{Imp}(X_j) = \frac{1}{B}\sum_{b=1}^{B}\ \sum_{\text{splits on } X_j \text{ in tree } b} \Delta I

  • \Delta I is the impurity decrease of a split: the reduction in RSS for regression trees, or in the Gini index for classification trees.

For each tree, sum the decreases of every split on the predictor, add these sums across the trees, and divide by B. A tree that never splits on a predictor contributes zero to its importance, but it still counts in the divisor B. Importances are usually reported rescaled so the largest is 100.

Three bagged fraud trees record the total Gini decrease from splits on each predictor. Which predictor is most important?

Tree Prior claims Claim amount Days to report
1 0.060 0.025 0
2 0.052 0 0.030
3 0.018 0.041 0.012
  • Prior claims: (0.060 + 0.052 + 0.018)/3 = 0.0433.
  • Claim amount: (0.025 + 0 + 0.041)/3 = 0.0220.
  • Days to report: (0 + 0.030 + 0.012)/3 = 0.0140.
  • Rescaled so the largest is 100, the importances are 100, 51 and 32, so prior claims is most important. Tree 3 alone would have ranked claim amount first.

Permutation importance

Permutation importance shuffles the values of X_j in the out-of-bag observations and measures how far the accuracy falls. It is slower than impurity-based importance, but it is not biased toward predictors with many distinct values, as impurity-based importance is.

Shuffling territory in the out-of-bag data raises a forest's out-of-bag MSE from 40 to 41, and shuffling prior claims raises it to 55. Which predictor matters more?

  • Breaking prior claims' link to the response costs 15 in MSE, against 1 for territory.
  • Prior claims is much more important.

Reading an importance ranking

An importance says a predictor matters, not which way it moves the prediction. Its direction and shape need a partial dependence plot. Correlated predictors split the credit between them, so either can look unimportant on its own, and dropping one makes the other's importance jump.

A low importance is not proof of no effect A predictor whose credit is taken by a correlated stronger one looks unimportant. Drop it, refit, and compare the out-of-bag error: an unchanged error means it was redundant, and a higher error means its importance hid a real contribution.

Practice questions

Actuarial Notes