Gini impurity measures how heterogeneous class labels are within a dataset region or decision-tree node. CART minimizes it when selecting feature thresholds, favoring pure leaves while limiting tree depth to reduce overfitting. section 5.6
Interpret the measure through class proportions:
- Let πk denote the fraction of points in a region belonging to class k. section 5.6
- A pure leaf has πk = 1 for its class and Gini impurity zero. section 5.6
- The measure can be interpreted as the expected error rate of assigning a random point using the region’s class distribution. section 5.6
Choosing a one-dimensional split
For X = [1.5, 1.7, 2.3, 2.7, 2.7] and y = [1, 1, 2, 2, 3], threshold 2 creates a pure left region and a mixed right region with labels [2, 2, 3]. CART compares this weighted impurity with alternatives and selects the minimum-cost split. section 5.6




