Description Usage Arguments Value Examples
Create a list of several train models from the caret package
Build a list of train objects suitable for ensembling using the caretEnsemble
function.
1 2 |
... |
arguments to pass to |
trControl |
a |
methodList |
optional, a character vector of caret models to ensemble. One of methodList or tuneList must be specified. |
tuneList |
optional, a NAMED list of caretModelSpec objects. This much more flexible than methodList and allows the specificaiton of model-specific parameters (e.g. passing trace=FALSE to nnet) |
continue_on_fail, |
logical, should a valid caretList be returned that excludes models that fail, default is FALSE |
A list of train
objects. If the model fails to build,
it is dropped from the list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
myControl <- trainControl(method="cv", number=5)
caretList(
Sepal.Length ~ Sepal.Width,
head(iris, 50),
methodList=c("glm", "lm"),
trControl=myControl
)
caretList(
Sepal.Length ~ Sepal.Width,
head(iris, 50), methodList=c("lm"),
tuneList=list(
nnet=caretModelSpec(method="nnet", trace=FALSE, tuneLength=1)
),
trControl=myControl
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.