Classical ML, validation, metrics, interpretation, debugging · insight-0182
Prefer held-out permutation importance to impurity importance for tree models
- Evidence type
- documented fact
- Difficulty
- medium
- Roles
- Data scientist, ML engineer
- Industries
- cross-industry
Summary: situation, action, reason, boundary
Situation
You report the feature_importances_ attribute of a random forest or gradient-boosting model.
Action
Compute permutation importance on held-out data, compare it with impurity importance, and investigate features that rank high only in-sample.
Reason
Impurity importance is computed from training splits and favours features with many split points; held-out permutation importance reflects contribution to generalization.
Boundary
Random forests, extra trees and gradient-boosted trees in scikit-learn and similar libraries.
Symptom or risk
High-cardinality or continuous features, including random ids, rank highly even when they do not help on new data.
Exceptions
For a quick look on a well-regularized model with similar-cardinality features, impurity importance can be a rough guide.
Trade-offs
Permutation importance costs extra scoring passes and depends on the evaluation metric.
Pitfalls
Computing permutation importance on the training set, which re-imports the overfitting bias.
Lessons and concepts
Claims and their sources
Impurity-based importance is computed on training data and is strongly biased toward high-cardinality features; permutation importance on held-out data avoids this bias.
Random forest variable importance is biased in favour of variables with many categories or split points.