plot.shap_aggregated {DALEX} | R Documentation |
Plot Generic for Break Down Objects
Description
Displays a waterfall aggregated shap plot for objects of shap_aggregated
class.
Usage
## S3 method for class 'shap_aggregated'
plot(
x,
...,
shift_contributions = 0.05,
add_contributions = TRUE,
add_boxplots = TRUE,
max_features = 10,
title = "Aggregated SHAP"
)
Arguments
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 |
Value
a ggplot2
object.
Examples
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"))
[Package DALEX version 2.4.3 Index]