Relative Content

Tag Archive for rrpart

Regression tree’s predicted results interpretation for type = “vector” in R

I am using rpart to build a CART model (method = “anova”) and predict.rpart with type = “vector to make a prediction. I understand that that way is building a regression tree, but I really have trouble understanding what the mean response at the node refers to by using type = “vector” according to the manual. Does it mean predicted probability or sort of averaged results for the predicted continuous outcome values?

Calculate the predicted probabilities for each class using rpart in R

I am new to use rpart to build CART models. I wonder if the following code is printing the predicted probabilities of each class value = 1 in predictions. And pred_class saves the predicted class (with the maximum predicted probability among three classes) for each observations.