Error in ctree_control ... unused argument.. in R

748 Views Asked by At

I would like to add 2 hyper parameters to my ctree model. Here is the code that runs:

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 ))

I works.

Now, I would like to add the parameters: minprob and ntree. Here is the code:

ct2 <- ctree(V1 ~ ., data = train,controls = ctree_control(mtry = 2,ntree = 500,minprob =0.1 ))

And I get error:

Error in ctree_control(mtry = 2, ntree = 500, minprob = 0.1) : 
  unused arguments (ntree = 500, minprob = 0.1)
0

There are 0 best solutions below