Learn R Programming

⚠️There's a newer version (4.0.1) of this package.Take me there.

caretEnsemble: (Read the vignette!)

Framework for fitting multiple caret models using the same re-sampling strategy as well as creating ensembles of such models. Use caretList to fit multiple models, and then use caretEnsemble to combine them greedily, or caretStack to combine them using a caret model.

caretEnsemble was inspired by medley, which in turn was inspired by Caruana et. al.'s (2004) paper Ensemble Selection from Libraries of Models.

Install the stable version from CRAN:

install.packages('caretEnsemble')

Install the dev version from github:

devtools::install_github('zachmayer/caretEnsemble')

There are also tagged versions of caretEnsemble on github you can install via devtools. For example, to install the original draft of the API:

devtools::install_github('zachmayer/caretEnsemble@0.0')

Code of Conduct:

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Copy Link

Version

Install

install.packages('caretEnsemble')

Monthly Downloads

3,055

Version

2.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Zachary A Mayer

Last Published

December 12th, 2019

Functions in caretEnsemble (2.0.1)

extractModelName

Extract the method name associated with a single train object
extractModRes

Extract the model accuracy metrics of the individual models in an ensemble object.
models.class

caretList of classification models
check_caretList_model_types

Checks that caretList models are all of the same type.
bestPreds

Extract the best predictions from a train object
c.caretList

S3 definition for concatenating caretList
as.caretList.list

Convert list to caretList
caretStack

Combine several predictive models via stacking
getBinaryTargetLevel

Return the configured target binary class level
is.caretList

Check if an object is a caretList object
caretModelSpec

Generate a specification for fitting a caret model
is.caretEnsemble

Check if an object is a caretEnsemble object
check_bestpreds_indexes

Check row indexes
check_caretList_classes

Checks caretList model classes
dotplot.caretStack

Comparison dotplot for a caretStack object
getMetric

Extract accuracy metrics from a model
extractBestPreds

Extract the best predictions from a list of train objects
extractCaretTarget.default

Extracts the target variable from a set of arguments headed to the caret::train.default function.
autoplot

Convenience function for more in-depth diagnostic plots of caretEnsemble objects
plot.caretStack

Plot a caretStack object
plot.caretEnsemble

Plot Diagnostics for an caretEnsemble Object
extractCaretTarget

Extracts the target variable from a set of arguments headed to the caret::train function.
print.caretStack

Print a caretStack object
multiResiduals

Calculate the residuals from all component models of a caretEnsemble.
extractCaretTarget.formula

Extracts the target variable from a set of arguments headed to the caret::train.formula function.
check_bestpreds_obs

Check observeds
validateBinaryTargetLevel

Validate arguments given as binary target level
residuals.caretEnsemble

Calculate the residuals from a caretEnsemble.
extractModFrame

Extract a dataframe of all predictors used in a caretEnsemble object.
makePredObsMatrix

Make a prediction matrix from a list of models
validateCustomModel

Validate a custom caret model info list
methodCheck

Check that the methods supplied by the user are valid caret methods
extractModelTypes

Extracts the model types from a list of train model
check_bestpreds_preds

Check predictions
predict.caretList

Create a matrix of predictions for each of the models in a caretList
fortify

Supplement the data fitted to a caret ensemble model with model fit statistics
predict.caretStack

Make predictions from a caretStack
setBinaryTargetLevel

Set the target binary class level
[.caretList

Index a caretList
tuneCheck

Check that the tuning parameters list supplied by the user is valid
trControlCheck

Check that the trainControl object supplied by the user is valid and has defined re-sampling indexes.
is.caretStack

Check if an object is a caretStack object
summary.caretEnsemble

Summarize the results of caretEnsemble for the user.
summary.caretStack

Summarize a caretStack object
varImp.caretEnsemble

Calculate the variable importance of variables in a caretEnsemble.
wtd.sd

Calculate a weighted standard deviation
caretList

Create a list of several train models from the caret package Build a list of train objects suitable for ensembling using the caretEnsemble function.
c.train

S3 definition for concatenating train objects
caretEnsemble

caretEnsemble: Make ensembles of caret models.
as.caretList

Convert object to caretList object
as.caretList.default

Convert object to caretList object - For Future Use
check_bestpreds_resamples

Check resamples