tidy_imp: tidy up dataframe containing model feature importance
Description
returns dataframe with exactly two columns, vars and imp and
aggregates dummy encoded variables. Helper function called by all functions
that take an imp parameter. Can be called manually if formula for
aggregating dummy encoded variables must be modified.
Usage
tidy_imp(imp, df, .f = max, resp_var = NULL)
Value
dataframe
vars
character column with feature names
imp
numerical column, importance values
Arguments
imp
dataframe or matrix with feature importance information
df
dataframe, modeling training data
.f
window function, Default: max
resp_var
character, prediction variable, can usually be inferred from
imp and df. It does not work for all models and needs to be specified in those
cases.