generate_shap_plots: Generate SHAP Plots

View source: R/generateFigures.R

generate_shap_plotsR Documentation

Generate SHAP Plots

Description

Creates a combined bar and beeswarm plot to show global and local feature importance

Usage

generate_shap_plots(
  mean_shap_values,
  long_shap_data,
  title_global = "SHAP Global Feature Importance",
  title_local = "SHAP Local Feature Explanation",
  fill_colors = c("blue", "red"),
  gradient_colors = c("blue", "red")
)

Arguments

mean_shap_values

A dataframe containing mean SHAP values and features

long_shap_data

A dataframe containing individual SHAP values for features

title_global

The title for the global feature importance plot

title_local

The title for the local feature explanation plot

fill_colors

A vector of colors to use for filling the bar plot

gradient_colors

A vector of colors to use for the color gradient in the beeswarm plot

Value

A combined ggplot object with a bar plot and a beeswarm plot

Examples

shapplot<-generate_shap_plots(mean_shap_values = shapvals$significant_features,long_shap_data = shapvals$long_shap_data)

tkolisnik/Rf2pval documentation built on Feb. 20, 2024, 5:39 a.m.