首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rpart回归树解释

rpart回归树解释
EN

Stack Overflow用户
提问于 2017-11-26 15:59:41
回答 1查看 3.8K关注 0票数 0

我在回归树上应用了rpart.plot,但我不知道节点内的值指的是什么。以及如何选择根?很多thanks.could你能解释一下每个节点里面的值是什么吗?(图为我的问题所在)

https://i.stack.imgur.com/tEofb.png

EN

回答 1

Stack Overflow用户

发布于 2017-11-26 21:37:09

据the rpart.plot vignette报道

对于具有连续响应的模型( anova模型),每个节点显示:

  • 预测值。
  • 节点中观测值的百分比。

下面是一个示例:

代码语言:javascript
复制
data(iris)
library(rpart)
library(rpart.plot)

rpart.plot(rpart(Sepal.Width ~., data = iris, cp = 0.1))

根节点显示mean Sepal.Width:

代码语言:javascript
复制
with(iris, round(mean(Sepal.Width), 1))
#output
[1] 3.1

左侧节点表示杂色和维吉尼亚组合物种的平均Sepal.Width

代码语言:javascript
复制
with(iris, round(mean(Sepal.Width[Species != "setosa"]), 1))
#output
[1] 2.9

右侧节点表示刚毛物种的平均Sepal.Width

代码语言:javascript
复制
with(iris, round(mean(Sepal.Width[Species == "setosa"]), 1))
#output
[1] 3.4

对于具有二进制响应的模型,每个节点都显示

  • 预测类。
  • 节点中观测值的预测百分比。
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47494113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档