Search for corresponding node in a regression tree using rpart

后端 未结 3 622
再見小時候
再見小時候 2020-12-17 00:04

I\'m pretty new to R and I\'m stuck with a pretty dumb problem.

I\'m calibrating a regression tree using the rpart package in order to do some class

3条回答
  •  一个人的身影
    2020-12-17 01:03

    I think what you want is type="vector" instead of class="prob" (I don't think class is an accepted parameter of the predict method), as explained in the rpart docs:

    If type="vector": vector of predicted responses. For regression trees this is the mean response at the node, for Poisson trees it is the estimated response rate, and for classification trees it is the predicted class (as a number).

提交回复
热议问题