caretx | R Documentation |
Converts a caret model (class train
) to
a caretx
object.
caretx(caret_model)
as_caretx(caret_model)
is_caretx(x)
caret_model |
a caret model (class |
x |
an object. |
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.
a caretx
object; is_caretx()
returns a logical value.
Kuhn M. Building predictive models in R using the caret package. J Stat Softw (2008) 28:1–26. doi:10.18637/jss.v028.i05
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.