Description Usage Arguments Value See Also Examples
takes the most important variables of a model and plots a tabplot::tableplot
1 2 | f_model_importance_plot_tableplot(data, ranked_variables, response_var,
limit = 10, print = F, ...)
|
data |
dataframe |
ranked_variables |
datafram as returned by f_model_importance() |
response_var |
character vector denoting response variable |
limit |
integer limit the number of variables , Default: 10 |
print |
boolean, print tabplot when generating tabplot object |
... |
pass kwargs to tabplot::tableplot |
tabplot::tableplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data = f_clean_data(mtcars) %>%
.$data
m = rpart::rpart( disp~., data)
ranked_variables = f_model_importance(m, data)
response_var = 'disp'
f_model_importance_plot_tableplot( data, ranked_variables, response_var, limit = 5 )
#pipe
form = as.formula('disp~cyl+mpg+hp')
pl = pipelearner::pipelearner(mtcars) %>%
pipelearner::learn_models( rpart::rpart, form ) %>%
pipelearner::learn_models( randomForest::randomForest, form ) %>%
pipelearner::learn_models( e1071::svm, form ) %>%
pipelearner::learn() %>%
mutate( imp = map2(fit, train, f_model_importance)
, tabplot = pmap( list( data = train
, ranked_variables = imp
, response_var = target
, title = model
)
, f_model_importance_plot_tableplot
, limit = 5
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.