powered by
Variable importance as measured by mean absolute SHAP value.
shap.importance(data_long, names_only = FALSE, top_n = Inf)
returns data.table with average absolute SHAP values per variable, sorted in decreasing order of importance.
data.table
a long format data of SHAP values from shap.prep
shap.prep
If TRUE, returns variable names only.
TRUE
How many variables to be returned?
shap.importance(shap_long_iris) shap.importance(shap_long_iris, names_only = 1)
Run the code above in your browser using DataLab