shap.plot.force_plot_bygroup: Make the stack plot, optional to zoom in at certain x or...

shap.plot.force_plot_bygroupR Documentation

Make the stack plot, optional to zoom in at certain x or certain cluster

Description

A collective display of zoom-in plots: one plot for every group of the clustered observations.

Usage

shap.plot.force_plot_bygroup(shapobs, id = "sorted_id", y_parent_limit = NULL)

Arguments

shapobs

The dataset obtained by shap.prep.stack.data.

id

the id variable.

y_parent_limit

set y-axis limits.

Examples


# **SHAP force plot**
plot_data <- shap.prep.stack.data(shap_contrib = shap_values_iris,
                                  n_groups = 4)
shap.plot.force_plot(plot_data)
shap.plot.force_plot(plot_data,  zoom_in_group = 2)

# plot all the clusters:
shap.plot.force_plot_bygroup(plot_data)

SHAPforxgboost documentation built on May 31, 2023, 8:20 p.m.