Learn R Programming

ShapleyOutlier (version 0.1.2)

plot.shapley_interaction: Plot of Shapley interaction indices

Description

Plot of Shapley interaction indices

Usage

# S3 method for shapley_interaction
plot(
  x,
  abbrev = 4,
  title = "Shapley Interaction",
  legend = TRUE,
  text_size = 22,
  ...
)

Value

Returns a figure consisting of two panels. The upper panel shows the Shapley values, and the lower panel the Shapley interaction indices.

Arguments

x

A \(p \times p\) matrix containing the Shapley interaction indices (shapley_interaction) of a single observation.

abbrev

Integer. If abbrev.var \(> 0\), variable names are abbreviated using abbreviate with minlenght = abrev.

title

Character. Title of the plot.

legend

Logical. If TRUE (default), a legend is plotted.

text_size

Integer. Size of the text in the plot

...

Optional arguments passed to methods.

Examples

Run this code
p <- 5
mu <- rep(0,p)
Sigma <- matrix(0.9, p, p); diag(Sigma) = 1
Sigma_inv <- solve(Sigma)
x <- c(0,1,2,2.3,2.5)
PHI <- shapley_interaction(x, mu, Sigma)
plot(PHI)

Run the code above in your browser using DataLab