Gini Impurity and Gini Gain
Definition (s.322), “corresponding to entropy”: randomly pick a datapoint, randomly classify it according to the class distribution of the dataset; the probability that we classify it incorrectly is the Gini impurity.
= total classes; = probability of picking a sample with class . Example (5 blue, 5 green points): .
Split impurity and Gini gain (s.323-324)
Weight each branch by its share of elements, e.g. . Gini Gain = original impurity − weighted branch impurities; the best split maximizes Gini gain.
- Split : , gain .
- Split : (), gain .
Exercise - Play Tennis (s.325-327)
- ; sunny (5/14) ; overcast (4/14) ; rainy (5/14) .
- Gini Gain(Outlook) .
- Temperature 0.0185; Humidity 0.0916; Windy 0.0304 → Outlook best.
Related
Concept - Entropy | Concept - Information Gain | Concept - Decision Tree | Concept - ID3