plot.shapley_interaction {ShapleyOutlier}R Documentation

Plot of Shapley interaction indices

Description

Plot of Shapley interaction indices

Usage

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

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.

Value

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

Examples

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)

[Package ShapleyOutlier version 0.1.1 Index]