Skip to content
ML Academy

Introduced on day 12

Impurity

A measure of how mixed the targets in a tree node are (variance for numbers, Gini or entropy for classes); splits are chosen to reduce it.

In detail

A node holding only flights that sold out has zero impurity for a sold-out label; a 50/50 node is maximally impure. A tree greedily chooses the feature and threshold that give the largest weighted drop in impurity in the two children. Impurity decreases are also the basis of impurity-based feature importance, which favours features with many distinct values (Day 17).