楼主: lucia85524
13071 4

[问答] Rpart决策树 有一个complexity Parameter是什么啊 [推广有奖]

  • 0关注
  • 0粉丝

已卖:1份资源

大专生

36%

还不是VIP/贵宾

-

威望
0
论坛币
9944 个
通用积分
0.0002
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
573 点
帖子
41
精华
0
在线时间
54 小时
注册时间
2007-4-25
最后登录
2014-11-7

楼主
lucia85524 发表于 2012-8-30 11:42:32 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
print (iris.rp$cptable,digit=2)
    CP nsplit rel error xerror  xstd
1 0.50      0      1.00   1.18 0.050
2 0.44      1      0.50   0.70 0.061
3 0.01      2      0.06   0.07 0.026
>

想问一下那个cp 也就是complexity parameter是做什么的?

另外用Rpart做决策树都应该关注哪些指标呢?谢谢。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Complexity Parameter paramete Complex rpart complexity

本帖被以下文库推荐

沙发
GoingMyWay 发表于 2013-11-6 10:10:05
看得懂就看吧。complexity parameter. Any split that does not decrease the overall lack of fit by a factor of cp is not attempted. For instance, with anova splitting, this means that the overall R-squared must increase by cp at each step. The main role of this parameter is to save computing time by pruning off splits that are obviously not worthwhile. Essentially,the user informs the program that any split which does not improve the fit by cp will likely be pruned off by cross-validation, and that hence the program need not pursue it.

藤椅
GoingMyWay 发表于 2013-11-6 10:12:08
我也是在R语言的帮助文档上看到的。其实CP和计算复杂度有那么点关系。complexity parameter. Any split that does not decrease the overall lack of fit by a factor of cp is not attempted. For instance, with anova splitting, this means that the overall R-squared must increase by cp at each step. The main role of this parameter is to save computing time by pruning off splits that are obviously not worthwhile. Essentially,the user informs the program that any split which does not improve the fit by cp will likely be pruned off by cross-validation, and that hence the program need not pursue it.

板凳
etey 发表于 2016-3-11 16:09:04
谢谢两位的帮助

报纸
135792486 发表于 2016-11-2 16:14:27
出处是  @悟乙己的博客

1、CP参数定义

cp: complexity parameter复杂性参数,用来修剪树的.

当决策树复杂度超过一定程度后,随着复杂度的提高,测试集的分类精确度反而会降低。因此,建立的决策树不宜太复杂,需进行剪枝。该剪枝算法依赖于复杂性参数cp,cp随树复杂度的增加而减小,当增加一个节点引起的分类精确度变化量小于树复杂度变化的cp倍时,则须剪去该节点。故建立一棵既能精确分类,又不过度适合的决策树的关键是求解一个合适的cp值。一般选择错判率最小值对应的cp值来修树.

2、CP选择问题。

建立树模型要权衡两方面问题,一个是要拟合得使分组后的变异较小,另一个是要防止过度拟合,而使模型的误差过大,前者的参数是CP,后者的参数是Xerror。所以要在Xerror最小的情况下,也使CP尽量小。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 03:49