Gini Impurity
A statistical metric used in decision trees to evaluate the probability that a randomly chosen element would be incorrectly classified if labeled automatically.
Think of It Like This
Like looking into a bowl of mixed fruit and calculating the odds of blindly grabbing a grape when you were actually hoping to pull out a strawberry.
Gini Impurity measures the frequency at which any element of a dataset will be mislabeled when it is randomly labeled according to the distribution of labels in the subset. Decision tree algorithms use this metric to decide the optimal feature to split on at each node. A Gini Impurity of zero indicates a perfectly pure node where all elements belong to one class.