plot_shap_bar: SHAP importance bar plot

View source: R/shap.R

plot_shap_barR Documentation

SHAP importance bar plot

Description

SHAP importance bar plot

Usage

plot_shap_bar(
  shap,
  x,
  sort = TRUE,
  labels = c("Negative", "Positive"),
  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().

sort

Logical whether to sort predictors by mean absolute SHAP value

labels

Character vector of labels for directionality

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.

Value

A ggplot2 plot


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