Skip to content
ML Academy

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

  1. Situation

    You report the feature_importances_ attribute of a random forest or gradient-boosting model.

  2. Action

    Compute permutation importance on held-out data, compare it with impurity importance, and investigate features that rank high only in-sample.

  3. Reason

    Impurity importance is computed from training splits and favours features with many split points; held-out permutation importance reflects contribution to generalization.

  4. 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