When building classifier decision trees, the Gini index is a metric used to determine the best way to split data at a given node. It is given by:
where is the probability of observations in the th region that are class .
The Gini index will be small if all are close to 1 or 0. The Gini index is also sometimes referred to as a measure of node purity, since a small value indicates that the node mostly contains observations from a single class.