plot_shap_beeswarm: SHAP importance beeswarm plot

View source: R/shap.R

plot_shap_beeswarmR Documentation

SHAP importance beeswarm plot

Description

SHAP importance beeswarm plot

Usage

plot_shap_beeswarm(
  shap,
  x,
  cex = 0.25,
  corral = "random",
  corral.width = 0.7,
  scheme = c("deepskyblue2", "purple3", "red"),
  sort = TRUE,
  top = NULL,
  ...
)

Arguments

shap

a matrix of SHAP values

x

a matrix or dataframe of feature values containing only features values from the training data. The rows must match rows in shap. If a dataframe is supplied it is converted to a numeric matrix using data.matrix().

cex

Scaling for adjusting point spacing. See ggbeeswarm::geom_beeswarm().

corral

String specifying method used to corral points. See ggbeeswarm::geom_beeswarm().

corral.width

Numeric specifying width of corral, passed to geom_beeswarm

scheme

Colour scheme as a vector of 3 colours

sort

Logical whether to sort predictors by mean absolute SHAP value.

top

Sets a limit on the number of variables plotted or NULL to plot all variables. If top is set then variables are sorted and sort is overrode.

...

Other arguments passed to ggbeeswarm::geom_beeswarm()

Value

A ggplot2 plot


nestedcv documentation built on Oct. 26, 2023, 5:08 p.m.