Gini impurity in Decision tress

decision_trees

#1

Hello everyone,

Im new to Decision trees.
Is the formula for gini in this guide correct -

It says -
Calculate, Gini for sub-node Female = (0.2)(0.2)+(0.8)(0.8)=0.68
Shoudn’t it be 1-[(0.2)(0.2)+(0.8)(0.8)]=1-0.68=0.32