Weighted average Gini impurity measures the total class impurity produced by a decision-tree split. Calculate Gini impurity separately for each child group, then combine the values according to the groups’ observation counts. Prefer the split with the lower weighted impurity when selecting a root or internal node. section 6.3.6
Use the metric to evaluate candidate splits:
- Partition the data on a categorical feature or numeric threshold. section 6.3.6
- Count the target classes in each child group and calculate each group’s Gini impurity. section 6.3.6
- Weight the child impurities by their row counts to obtain one impurity value for the feature or threshold. section 6.3.6
Evaluating a numeric threshold
For TO_GO <= 3.5, the child contains 127 failures and 268 conversions; for TO_GO > 3.5, it contains 156 failures and 67 conversions. These class counts provide the inputs for calculating both child impurities and their row-count-weighted combination.

