Why is information gain biased toward features with high cardinality?

Quick Overview

Asks why information gain favors features with many distinct values when a decision tree chooses its splits. Tests the small-sample purity argument, the unique ID extreme case, gain ratio and other corrections, and the effect on feature importance.

Why is information gain biased toward features with high cardinality?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

When a decision tree picks splits by information gain, why is it biased toward features with high cardinality (many distinct values)? ```hint Try the extreme Work out the information gain of splitting on a column that holds a unique ID for every row. ``` ```hint Small groups Ask how pure a group of two or three rows tends to be when the feature and the label are unrelated. ``` ### What a Strong Answer Covers - The mechanism that inflates the gain of a feature with many values. - What happens in the extreme case of an ID column. - The statistical reason behind the bias, for both multiway and binary splits. - Mitigations, and how far each one goes. - The effect on feature importance. ### Follow-up Questions - Does gain ratio remove the bias completely? When can it overcorrect? - Does the same bias affect Gini impurity and binary-split trees such as CART? - How would you encode a categorical feature with 10,000 levels for a tree model? - How would you check whether a feature's high importance in a random forest is real?

Overview: Asks why information gain favors features with many distinct values when a decision tree chooses its splits. Tests the small-sample purity argument, the unique ID extreme case, gain ratio and other corrections, and the effect on feature importance.

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

When a decision tree picks splits by information gain, why is it biased toward features with high cardinality (many distinct values)?

What a Strong Answer Covers Guidance

  • The mechanism that inflates the gain of a feature with many values.
  • What happens in the extreme case of an ID column.
  • The statistical reason behind the bias, for both multiway and binary splits.
  • Mitigations, and how far each one goes.
  • The effect on feature importance.

Follow-up Questions Guidance

  • Does gain ratio remove the bias completely? When can it overcorrect?
  • Does the same bias affect Gini impurity and binary-split trees such as CART?
  • How would you encode a categorical feature with 10,000 levels for a tree model?
  • How would you check whether a feature's high importance in a random forest is real?