179 questions
No questions match those filters.
How does a decision tree pick its splits, and why can i...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansAt each node, the tree evaluates every candidate feature (and, for continuous features, every candidate threshold) and picks the split that most reduces entropy in the child nodes versus the parent — that reduction is the information gain. The problem is that information gain is structurally biased toward features with many distinct values: a feature that’s nearly a unique identifier for each row (a customer ID, a timestamp) can split the data into pure singleton leaves, producing the maximum possible information gain while capturing zero generalizable signal — pure overfitting to identity rather than pattern.
The C4.5 fix is gain ratio, which normalizes information gain by the entropy of the split itself (how many branches it creates and how evenly it divides the data), so a split into a thousand tiny branches gets penalized for the split’s own complexity rather than simply rewarded for how pure the resulting leaves look. CART instead typically uses Gini impurity, which doesn’t share the same many-valued bias because it doesn’t reward fragmentation the way raw entropy-based gain does. The lesson generalizes past trees: any greedy criterion that measures purity without accounting for the number of ways you achieved it will overfit to high-cardinality categorical features, which is also why you should be suspicious of raw feature-importance rankings from a single unregularized tree.