[R] Class probabilities in rpart

Terry Therneau therneau at mayo.edu
Mon Sep 17 16:49:14 CEST 2007


> The predict.rpart() function from the rpart library allows for 
> calculating the class probabilities for a given test case instead of a 
> discrete class label.

> How are these class probabilities derived? Is it simply the proportion 
> of the majority class to all cases in a leaf node?

    That is almost correct.  If there are prior probabilities, it will be the
expected proportion of each class, accounting for priors.  If there are no
priors, then the expected proportion = observed proportion.

	Terry Therneau



More information about the R-help mailing list