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

2,864

Version

2.0.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 20th, 2023

Functions in caretEnsemble (2.0.3)

extractCaretTarget.formula

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

Create a matrix of predictions for each of the models in a caretList
models.class

caretList of classification models
print.caretStack

Print a caretStack object
varImp.caretEnsemble

Calculate the variable importance of variables in a caretEnsemble.
fortify

Supplement the data fitted to a caret ensemble model with model fit statistics
methodCheck

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

Make a prediction matrix from a list of models
extractModelTypes

Extracts the model types from a list of train model
check_caretList_model_types

Checks that caretList models are all of the same type.
residuals.caretEnsemble

Calculate the residuals from a caretEnsemble.
validateBinaryTargetLevel

Validate arguments given as binary target level
validateCustomModel

Validate a custom caret model info list
predict.caretStack

Make predictions from a caretStack
wtd.sd

Calculate a weighted standard deviation
getMetric

Extract accuracy metrics from a model
is.caretEnsemble

Check if an object is a caretEnsemble object
check_caretList_classes

Checks caretList model classes
is.caretList

Check if an object is a caretList object
getBinaryTargetLevel

Return the configured target binary class level
setBinaryTargetLevel

Set the target binary class level
is.caretStack

Check if an object is a caretStack object
extractModFrame

Extract a dataframe of all predictors used in a caretEnsemble object.
[.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.
multiResiduals

Calculate the residuals from all component models of a caretEnsemble.
plot.caretStack

Plot a caretStack object
plot.caretEnsemble

Plot Diagnostics for an caretEnsemble Object
extractModRes

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

Summarize a caretStack object
summary.caretEnsemble

Summarize the results of caretEnsemble for the user.
extractModelName

Extract the method name associated with a single train object
c.caretList

S3 definition for concatenating caretList
autoplot

Convenience function for more in-depth diagnostic plots of caretEnsemble objects
as.caretList

Convert object to caretList object
as.caretList.default

Convert object to caretList object - For Future Use
bestPreds

Extract the best predictions from a train object
as.caretList.list

Convert list to caretList
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
caretModelSpec

Generate a specification for fitting a caret model
caretEnsemble

caretEnsemble: Make ensembles of caret models.
check_bestpreds_obs

Check observeds
check_bestpreds_preds

Check predictions
dotplot.caretStack

Comparison dotplot for a caretStack object
check_bestpreds_resamples

Check resamples
extractBestPreds

Extract the best predictions from a list of train objects
extractCaretTarget

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

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

Combine several predictive models via stacking
check_bestpreds_indexes

Check row indexes