CARET is a convenient tool that wraps dozens of modelling methods. CARET allows the user to access performance statistics such as RMSE, confusion matrices, etc. in a generic way without having to recall the usage of various modeling methods.
However, some models have unique reporting outcomes. For example, with a boosted tree model one can compare the in-sample vs. out-sample error-rate as a function of the number of trees to test for overfitting. Naturally this report would not make sense with other methods that do not use trees.
Is there a way I can use CARET to access these model-specific reports (maybe by accessing the modeling object generated directly)?
Best Answer
The
train
function incaret
returns an S3 list object. On of the items in this list is calledfinalModel
. This item is just the fitted object in it's native form. So if you trained a gbm usingtrain
and stored it in an object calledmy.fit
, thensummary(my.fit$finalModel)
would use thesummary.gbm
method from thegbm
package and show you the relative variable importance.