A data scientist trains a decision tree in PROC HPSPLIT. The output shows a leaf node with 3 observations, all of the same class. What is the Gini impurity of this node?
Select an answer to reveal the explanation.
Short Explanation
When all observations in a leaf belong to the same class, that node is pure, so its Gini impurity is 0.00. You calculate it as 1 minus the sum of squared class probabilities, and here that sum is 1.0.
Full Explanation
The correct value is 0.00 because Gini impurity = 1 - sum(p_i^2). When all observations in a node belong to the same class, one class probability is 1.0 and all others are 0.0. Gini = 1 - (1.0^2 + 0^2 + ...) = 1 - 1 = 0.00. A pure node has Gini impurity of exactly 0. The 0.50 value is the maximum Gini impurity for a binary classification with equal class distribution, so it does not describe a pure node. The 0.33 value and the 1.00 value are wrong values for this node.