How is permutation feature importance calculated using out-of-bag samples in a random forest?

Quick Overview

Asks how a random forest computes permutation feature importance on out-of-bag rows, step by step. Tests knowledge of OOB evaluation, how the per-tree scores are combined and scaled, and the caveats with correlated features and noisy estimates.

How is permutation feature importance calculated using out-of-bag samples in a random forest?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How is permutation feature importance calculated using out-of-bag samples in a random forest? ```hint Which rows to use Every tree in a random forest skipped some training rows when it was built. Think about how those rows could test what a single feature contributes to that tree, without retraining anything. ``` ### What a Strong Answer Covers - The per-tree steps: baseline error, the permutation, the re-measured error, and how the results are combined across trees - Why out-of-bag rows are used and what that gains over impurity-based importance - The optional scaled version of the score and how far it can be trusted - Caveats with correlated features and noisy estimates, and how to reduce them - How common libraries implement the method ### Follow-up Questions - How does conditional permutation importance deal with correlated features? - How does permutation importance differ from drop-column importance, and when is the extra cost worth it? - What does a negative permutation importance mean? - Why is impurity-based importance (MDI) biased toward features with many distinct values?

Overview: Asks how a random forest computes permutation feature importance on out-of-bag rows, step by step. Tests knowledge of OOB evaluation, how the per-tree scores are combined and scaled, and the caveats with correlated features and noisy estimates.

PracHub logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How is permutation feature importance calculated using out-of-bag samples in a random forest?

What a Strong Answer Covers Guidance

  • The per-tree steps: baseline error, the permutation, the re-measured error, and how the results are combined across trees
  • Why out-of-bag rows are used and what that gains over impurity-based importance
  • The optional scaled version of the score and how far it can be trusted
  • Caveats with correlated features and noisy estimates, and how to reduce them
  • How common libraries implement the method

Follow-up Questions Guidance

  • How does conditional permutation importance deal with correlated features?
  • How does permutation importance differ from drop-column importance, and when is the extra cost worth it?
  • What does a negative permutation importance mean?
  • Why is impurity-based importance (MDI) biased toward features with many distinct values?