Gini impurity
Gini is the probability of misclassifying a randomly chosen sample when labels are assigned according to the node's class distribution.
Decision trees · Chapter 2
Both measures answer the same practical question: how mixed are the classes inside this node?
Gini is the probability of misclassifying a randomly chosen sample when labels are assigned according to the node's class distribution.
Entropy measures uncertainty. It is zero in a pure node and increases as the class distribution becomes more even.
They often choose the same split. Their numeric scales differ, so compare gains within one criterion rather than comparing raw Gini and entropy values directly.
With two samples from Class A and two from Class B, Gini is0.5 and entropy is 1 bit. If all four samples share one class, both measures become zero.
Return to the first lesson and switch the impurity measure. The control runs the training algorithm again; it does not replace the number in the interface.