View source: R/importance_train.R
importance.train | R Documentation |
Importance Plot for the caret::train objects
## S3 method for class 'train'
importance(model_final, ...)
model_final |
a model object |
... |
arguments passed to other methods |
an object of type importance_plot
type |
the type of importance plot |
data |
the importance data required for the plot |
importance
if (requireNamespace("caret", quietly = TRUE) &
requireNamespace("randomForest", quietly = TRUE))
{
model_final <- caret::train(x = subset(mtcars, select = -mpg), y = mtcars$mpg, method = "rf")
imp <- importance(model_final)
plot(imp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.