Image for Gini impurity

Gini impurity

Gini impurity measures how mixed a group is in terms of different categories. For example, if a group has mostly one type of item, it has low impurity; if it’s evenly spread across many types, it has high impurity. In decision trees, Gini impurity helps determine the best way to split data by identifying the division that results in the purest groups. A lower Gini impurity indicates more uniform groups, which helps the tree make clearer decisions. Overall, it’s a way to quantify how well a split reduces uncertainty and improves classification accuracy.