How is permutation feature importance calculated using out-of-bag samples?
Last updated
For each tree, measure error on its OOB rows, permute feature j within those rows, and re-measure. Importance is the mean error increase across trees (optionally divided by its standard deviation).
Using OOB rows reflects predictive value on unseen data without a separate validation set. R reports it as Mean Decrease Accuracy, while scikit-learn's
permutation_importanceuses a held-out set instead.Correlated features create unrealistic shuffled rows and mask each other, and results are noisy, so use several repeats.