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 81.2 #> 3 wt 70.2 #> 4 hp 51.1 #> 5 vs 45.2 #> 6 am 25.2 #> 7 carb 12.2 #> 8 drat 12.1 #> 9 gear 8.71plot(vi)