Let X (discrete random variable) takes values y₊ and y₋ (two classes). Now, let’s consider the different cases:
Case- 1: When 100% observations belong to y₊ . Then, the Gini impurity of the system would be: –
Case- 2: When 50% observations belong to y₊ . Then, the Gini impurity of the system would be: –
Case- 3: When 0% observations belong to y₊ . Then, the Gini impurity of the system would be: –
After observing all these cases, the graph of Gini impurity w.r.t to y₊ would come out to be: