The plot.Explain
function provides various visualization methods for Shapley values.
The values and format used in the graph are determined based on the input parameters.
# S3 method for Explain
plot(
x,
average = NULL,
type = NULL,
num_post = NULL,
plot.flag = TRUE,
adjust = FALSE,
probs = 0.95,
title = NULL,
...
)
The plot is returned based on the specified option.:
If average is "obs"
or "post"
, a bar plot or summary plot is generated based on the selected averaging criterion. If average is "both"
, a boxplot is displayed to
show the distribution of Shapley values computed using both criteria. If adjust is TRUE
, the adjusted Shapley values are displayed.
If num_post
is specified, a bar plot or summary plot for the selected posterior sample is generated.
An Explain
class object containing the Shapley values of models.
Input the reference value for calculating the mean of the object's phi
list.
"obs"
represents the average based on observations (#post by #variable),
while "post"
represents the average based on posterior samples (#obs by #variable).
If "both"
is entered, calculations are performed based on both observation and posterior sample criteria.
If no value is specified, "both" is used as the default.
"bar"
represents a bar chart that includes the average contribution of each variable,
while "bee"
represents a summary plot, allowing you to determine the graph's format.
To check the contribution of variables for a single posterior sample, enter a value within the number of posterior samples.
If average = "obs"
, the quantile interval of each variable's is provided by default.
The default value is FALSE
.
Enter TRUE
to check the Shapley values adjusted based on the model's average contribution.
Enter the probability for the quantile interval. The default value is 0.95
.
The title of the plot, with a default value of NULL
.
Additional arguments to be passed