View source: R/plot_shap_aggregated.R
plot.shap_aggregated | R Documentation |
Displays a waterfall aggregated shap plot for objects of shap_aggregated
class.
## S3 method for class 'shap_aggregated' plot( x, ..., shift_contributions = 0.05, add_contributions = TRUE, add_boxplots = TRUE, max_features = 10, title = "Aggregated SHAP" )
x |
an explanation object created with function |
... |
other parameters like |
shift_contributions |
number describing how much labels should be shifted to the right, as a fraction of range. By default equal to |
add_contributions |
if |
add_boxplots |
if |
max_features |
maximal number of features to be included in the plot. default value is |
title |
a character. Plot title. By default |
a ggplot2
object.
library("DALEX") set.seed(1313) model_titanic_glm <- glm(survived ~ gender + age + fare, data = titanic_imputed, family = "binomial") explain_titanic_glm <- explain(model_titanic_glm, data = titanic_imputed, y = titanic_imputed$survived, label = "glm") bd_glm <- shap_aggregated(explain_titanic_glm, titanic_imputed[1:10, ]) bd_glm plot(bd_glm) plot(bd_glm, max_features = 3) plot(bd_glm, max_features = 3, vnames = c("average","+ male","+ young","+ cheap ticket", "+ other factors", "final"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.