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 and Infographic
Here's the deal — d is correct 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.
Full explanation below image
Full Explanation
D is correct 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. A (0.50) is the maximum Gini impurity for a binary classification with equal class distribution. B and C are wrong values.