View source: R/generateFigures.R
generate_shap_plots | R Documentation |
Creates a combined bar and beeswarm plot to show global and local feature importance
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")
)
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 |
A combined ggplot object with a bar plot and a beeswarm plot
shapplot<-generate_shap_plots(mean_shap_values = shapvals$significant_features,long_shap_data = shapvals$long_shap_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.