Learn R Programming

caretEnsemble (version 1.0.0)

caretStack: Combine several predictive models via stacking

Description

Find a good linear combination of several classification or regression models, using either linear regression, elastic net regression, or greedy optimization.

Usage

caretStack(all.models, ...)

Arguments

all.models
a list of caret models to ensemble.
...
additional arguments to pass to the optimization function

Value

  • S3 caretStack object

Details

Check the models, and make a matrix of obs and preds

References

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.60.2859&rep=rep1&type=pdf

Examples

Run this code
library('rpart')
models <- caretList(
  x=iris[1:50,1:2],
  y=iris[1:50,3],
  trControl=trainControl(method='cv'),
  methodList=c('rpart', 'glm')
)
caretStack(models, method='glm')

Run the code above in your browser using DataLab