get_vi | R Documentation |
Compute variable importance scores for the predictors in a model. Note that
get_vi
is a simple wrapper for vip::vi
.
get_vi(mfit, ...)
mfit |
Fitted model object (e.g., a "gbm" or "randomForest" object). |
... |
Additional optional arguments to be passed onto
|
Tidy data frame (i.e., a "tibble" object) with two columns:
Variable
and Importance
.
vi
and
https://CRAN.R-project.org/package=vip.
## Not run:
data('mtpl_be')
features <- setdiff(names(mtpl_be), c('id', 'nclaims', 'expo', 'long', 'lat'))
set.seed(12345)
gbm_fit <- gbm::gbm(as.formula(paste('nclaims ~',
paste(features, collapse = ' + '))),
distribution = 'poisson',
data = mtpl_be,
n.trees = 50,
interaction.depth = 3,
shrinkage = 0.1)
gbm_fit %>% get_vi
gbm_fit %>% get_vi(scale = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.