tidy_shap | R Documentation |
plot and summarize shapley values from an xgboost model
tidy_shap(model, newdata, form = NULL, ..., top_n = 12, aggregate = NULL)
model |
xgboost model |
newdata |
dataframe similar to model input |
form |
formula used for model |
... |
additional parameters for shapley value |
top_n |
top n features |
aggregate |
a character vector. Predictors containing the string will be aggregated, and renamed to that string. |
returns a list with the following entries
: table of shaply values
: table summarizing shapley values. Includes correlation between shaps and feature values.
: one plot showing the relation between shaps and features
: returns the top 9 most important features as determined by sum of absolute shapley values, as a facetted scatterplot of feature vs shap
list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.