如何在插入符列车中指定 minbucket? [英] How to specify minbucket in caret train for?

查看:38
本文介绍了如何在插入符列车中指定 minbucket?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 CART 模型,caret 似乎只提供复杂性参数的调整.有没有办法调整其他参数,比如minbucket?

For CART model, caret seems to only provide tunning of complexity parameter. Is there way to tune other parameters such as minbucket?

推荐答案

传递给分类或回归例程的参数包含在 dots 参数中.

Arguments passed to the classification or regression routines are included in the dots parameter.

因为你想包含minbucket,参数control应该包含在train中.

As you want to include minbucket, parameter control should be included inside train.

例如:

library("caret")

train(Kyphosis ~ Age + Number + Start, data = kyphosis, 
      method = "rpart",
      tuneGrid = data.frame(cp = c(0.01, 0.05)),
      control = rpart.control(minsplit = 10, minbucket = 5))

如果您想调整 minbucket,您必须手动进行.

If you want to tune minbucket you will have to do it manually.

这篇关于如何在插入符列车中指定 minbucket?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆