Closed pglez82 closed 8 years ago
The culprit is the methodList=c("rf")
argument, which trains models with the default caret tune grid. This should fix the issue:
library(caretEnsemble)
x=iris[,1:4]
y=iris[,5]
set.seed(7)
models<-caretList(x,y,
trControl=trainControl(method="cv",number=5,savePredictions="final"),
tuneList=list(
rf1=caretModelSpec(method="rf", tuneGrid=data.frame(.mtry=c(2,4))),
rf2=caretModelSpec(method="rf", tuneGrid=data.frame(.mtry=c(8,10)))
))
Hello everyone,
I have a very simple question about caretList. I will explain it in a very easy example.
I have trained two models using caretList:
I thought that caretList would return 2 models but It returns 3 instead. This extra model has the default caret tuneGrid. Is there any way to avoid creating this third model?
Thank you!