How is Mean Decrease in Impurity feature importance computed in a Random Forest?

Quick Overview

Asks how mean decrease in impurity feature importance is calculated for a random forest, from a single split up to the final scores. It tests node-weighted impurity reduction, per-tree normalization and averaging, and the known biases of this importance measure.

How is Mean Decrease in Impurity feature importance computed in a Random Forest?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How is Mean Decrease in Impurity feature importance computed in a Random Forest? ```hint Start from one split Work out how much impurity a single split removes, and think about how to weight it by the number of samples that split affects. ``` ### What a Strong Answer Covers - The impurity decrease at one split and how it is weighted by node size - Which impurity measure applies to classification and which to regression - How per-split decreases are summed within a tree, normalized and averaged across the forest - What the score does and does not measure, including its known biases ### Follow-up Questions - Why is MDI biased toward high-cardinality features, and how does permutation importance avoid that? - What happens to MDI scores when two features are highly correlated? - How would you measure feature importance in a way that reflects performance on new data?

Overview: Asks how mean decrease in impurity feature importance is calculated for a random forest, from a single split up to the final scores. It tests node-weighted impurity reduction, per-tree normalization and averaging, and the known biases of this importance measure.

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

How is Mean Decrease in Impurity feature importance computed in a Random Forest?

What a Strong Answer Covers Guidance

  • The impurity decrease at one split and how it is weighted by node size
  • Which impurity measure applies to classification and which to regression
  • How per-split decreases are summed within a tree, normalized and averaged across the forest
  • What the score does and does not measure, including its known biases

Follow-up Questions Guidance

  • Why is MDI biased toward high-cardinality features, and how does permutation importance avoid that?
  • What happens to MDI scores when two features are highly correlated?
  • How would you measure feature importance in a way that reflects performance on new data?