Impurity of a Small Decision Tree Node
A classification node can use the distribution of labels to measure how mixed its examples are under a chosen impurity rule.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace Gini impurity
For two A and two B labels, \(1-\sum p_i^2=1-(1/2)^2-(1/2)^2=1/2\). A pure node gives zero because one probability is one. Frequency proportions supply those class fractions.
Compare a candidate split
A split producing two pure child nodes removes that measured impurity on the examples. Evaluate how it generalizes separately. See tree split selection.[1]
Calculate class proportions before impurity
A node holds three class A and one class B samples. Its Gini impurity is \(1-(3/4)^2-(1/4)^2=3/8\). A pure node gives zero. During a split criterion, child impurity contributions are generally weighted by child size. See weighted group rates.
Parent counts 3 A, 1 B: impurity .375
Split into (2 A) and (1 A,1 B)
Children impurity 0 and .5, weighted average .25
Decrease .125
Test when a small pure child offers little improvement
A split creating one tiny pure leaf can leave a large mixed child. Weighting reflects how many examples go to each. Evaluate justifiable constraints on small leaves.