caretx: Create a caretx object.

View source: R/builders.R

caretxR Documentation

Create a caretx object.

Description

Converts a caret model (class train) to a caretx object.

Usage

caretx(caret_model)

as_caretx(caret_model)

is_caretx(x)

Arguments

caret_model

a caret model (class train).

x

an object.

Details

The input caret model has to contain a table with the final model predictions (trainControl, savePredictions = 'final'), training data (trainControl, returnData = TRUE) and final model resamples raining data (trainControl, returnResamp = 'final'). For classification models, the final model probabilities need to be provided (trainControl, classProbs = TRUE). Currently designed to work only with cross-validated models (trainControl, method = 'cv' or 'repeatedcv'), generated with a formula. Of note, in case of binary classifiers, the 'positive' outcome is defined by the second level of the outcome variable. I.e. if ⁠outcome <- factor(x, c('a', 'b')⁠, the level b is considered as the event of interest.

Value

a caretx object; is_caretx() returns a logical value.

References

Kuhn M. Building predictive models in R using the caret package. J Stat Softw (2008) 28:1–26. doi:10.18637/jss.v028.i05


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.