powered by
Plot of Shapley interaction indices
# S3 method for shapley_interaction plot( x, abbrev = 4, title = "Shapley Interaction", legend = TRUE, text_size = 22, ... )
Returns a figure consisting of two panels. The upper panel shows the Shapley values, and the lower panel the Shapley interaction indices.
A \(p \times p\) matrix containing the Shapley interaction indices (shapley_interaction) of a single observation.
shapley_interaction
Integer. If abbrev.var \(> 0\), variable names are abbreviated using abbreviate with minlenght = abrev.
abbrev.var
minlenght = abrev
Character. Title of the plot.
Logical. If TRUE (default), a legend is plotted.
Integer. Size of the text in the plot
Optional arguments passed to methods.
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