我在回归树上应用了rpart.plot,但我不知道节点内的值指的是什么。以及如何选择根?很多thanks.could你能解释一下每个节点里面的值是什么吗?(图为我的问题所在)
发布于 2017-11-26 21:37:09
据the rpart.plot vignette报道
对于具有连续响应的模型( anova模型),每个节点显示:
下面是一个示例:
data(iris)
library(rpart)
library(rpart.plot)
rpart.plot(rpart(Sepal.Width ~., data = iris, cp = 0.1))

根节点显示mean Sepal.Width:
with(iris, round(mean(Sepal.Width), 1))
#output
[1] 3.1左侧节点表示杂色和维吉尼亚组合物种的平均Sepal.Width
with(iris, round(mean(Sepal.Width[Species != "setosa"]), 1))
#output
[1] 2.9右侧节点表示刚毛物种的平均Sepal.Width
with(iris, round(mean(Sepal.Width[Species == "setosa"]), 1))
#output
[1] 3.4对于具有二进制响应的模型,每个节点都显示
https://stackoverflow.com/questions/47494113
复制相似问题