Classification trees, determining prediction in leaf My question is how the prediction in the leaf is calculated for classification trees with more than 2 classes.
With regression trees its simple, its just the sample mean of the observations ending up in that leaf of the training sample.
With binary classification its the same and then you decide 1 if the result is >0.5 and 0 if it is <0.5.
But how are we doing it if there are more than two classes? Just pick the class that has the highest relative frequency? Or are we calculating also a mean and then pick the class that is closest to that mean? For instance, mean over observations is 3.4 therefore our prediction is class 3?

Averaging class labels doesn't make sense. Usually in tree based methods, each decision tree predicts a probability distribution over the classes based on the number of samples of each class in the leaf. The final prediction is obtained by averaging each tree's probability. The predicted class is the class that has the highest mean probability. Note that this procedure is not dependent on the number of classes.
