我想在我的 ctree 模型中添加 2 个超参数。这是运行的代码:
library(party)
dat1 <- fread('https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data',stringsAsFactors=T)
## split data to train and test
set.seed(123)
dat1 <- subset(dat1, !is.na(V1))
smp_size<-100
train_ind <- sample(seq_len(nrow(dat1)), size = smp_size)
train <- dat1[train_ind, ]
test <- dat1[-train_ind, ]
ct2 <- ctree(V1 ~ ., data = train,controls = ctree_control(mtry = 2 ))
我工作。
现在,我想添加参数:minprob
和ntree
. 这是代码:
ct2 <- ctree(V1 ~ ., data = train,controls = ctree_control(mtry = 2,ntree = 500,minprob =0.1 ))
我得到错误:
Error in ctree_control(mtry = 2, ntree = 500, minprob = 0.1) :
unused arguments (ntree = 500, minprob = 0.1)