get_variable_importance.Rd
Get variable importances
get_variable_importance(models, remove_zeros = TRUE, top_n)
models | model_list object |
---|---|
remove_zeros | Remove features with zero variable importance? Default is TRUE |
top_n | Integer: How many variables to return? The top_n most important variables be returned. If missing (default), all variables are returned |
Data frame of variables and their importance for predictive power
Some algorithms provide variable importance, others don't. The best-performing model that offers variable importance will be used.
#>#> #>#> #>#>#>#> #>#>(vi <- get_variable_importance(m))#> # A tibble: 9 x 2 #> variable importance #> * <chr> <dbl> #> 1 cyl 100 #> 2 disp 60.7 #> 3 wt 60.6 #> 4 hp 44.9 #> 5 am 29.0 #> 6 vs 28.4 #> 7 gear 11.2 #> 8 carb 9.62 #> 9 drat 7.06plot(vi)