for classification problemusing the indicator loss and constant regional prediction function as in ( )the aim is to choose splitting rule that minimizes { * { * } ( , ) ( , ) ( where * gt (xis the most prevalent class (majority votein the data set st and * is the most prevalent class in sf if the feature space is and the splitting rules are of the form ( )then the optimal splitting rule can be obtained in the same way as described above for the regression casethe only difference is that ( is replaced with ( we can view the minimization of ( as minimizing weighted average of "impuritiesof nodes st and sf namelyfor an arbitrary training subset tif yis the most prevalent labelthen { { py max pz { , - | ( , ) | ( , ) where pz is the proportion of data points in that have class label zz the quantity max pz { , - misclassification measures the diversity of the labels in and is called the misclassification impurity conimpurity sequently( is the weighted sum of the misclassification impurities of st and sf with entropy impurity weights by |st |/ and |sf |/nrespectively note that the misclassification impurity only depends on the label proportions rather than on the individual responses instead of using the misclassification impurity to decide if and how to split data set swe can use other impurity measures that only depend on the label proportions two popular choices are the entropy impurityc- pz log (pz = gini impurity and the gini impurityc- = all of these impurities are maximal when the label proportions are equal to / typical shapes of the above impurity measures are illustrated in figure for the two-label casewith class probabilities and we see here the similarity of the different impurity measures note that impurities can be arbitrarily scaledand so using ln(pz log (pz ln( instead of log (pz above gives an equivalent entropy impurity termination criterion when building treeone can define various types of termination conditions for examplewe might stop when the number of data points in the tree node (the size of the input set in algorithm is less than or equal to some predefined number or we might choose the maximal depth of the tree in advance another possibility is to stop when there is no