Why is impurity-based importance biased toward high-cardinality and continuous features?

Quick Overview

Explain why mean decrease in impurity favors continuous and high-cardinality features in tree ensembles such as random forests. Tests understanding of how split search on training data rewards chance improvements, why deep trees make it worse, and which importance measures avoid the bias.

Why is impurity-based importance biased toward high-cardinality and continuous features?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why is impurity-based importance biased toward high-cardinality and continuous features? Impurity-based importance, also called mean decrease in impurity (MDI), is the default `feature_importances_` in scikit-learn's tree ensembles. ```hint Count the candidate splits Compare how many distinct thresholds a binary feature and a continuous feature offer at a node, and think about the best of many random tries. ``` ```hint Check which data is scored Ask on which rows the impurity decrease is measured, and whether anything in that number rewards splits that generalize. ``` ### What a Strong Answer Covers - How MDI is computed and on which data. - Why the number of candidate splits a feature offers changes its expected impurity reduction when it carries no signal. - Why the effect grows with tree depth and small nodes. - Concrete mitigations and what each one fixes. ### Follow-up Questions - Permutation importance has its own problem with correlated features. What is it, and how would you handle it? - How does adding a random noise column help, and how should you read features that rank below it? - Does the same bias affect gain-based importance in gradient-boosted trees? - Why does an unordered categorical feature with many levels show the same bias?

Overview: Explain why mean decrease in impurity favors continuous and high-cardinality features in tree ensembles such as random forests. Tests understanding of how split search on training data rewards chance improvements, why deep trees make it worse, and which importance measures avoid the bias.

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

Why is impurity-based importance biased toward high-cardinality and continuous features?

Impurity-based importance, also called mean decrease in impurity (MDI), is the default feature_importances_ in scikit-learn's tree ensembles.

What a Strong Answer Covers Guidance

  • How MDI is computed and on which data.
  • Why the number of candidate splits a feature offers changes its expected impurity reduction when it carries no signal.
  • Why the effect grows with tree depth and small nodes.
  • Concrete mitigations and what each one fixes.

Follow-up Questions Guidance

  • Permutation importance has its own problem with correlated features. What is it, and how would you handle it?
  • How does adding a random noise column help, and how should you read features that rank below it?
  • Does the same bias affect gain-based importance in gradient-boosted trees?
  • Why does an unordered categorical feature with many levels show the same bias?