shapiq.plot.beeswarm_plotΒΆ
- shapiq.plot.beeswarm_plot(interaction_values_list, data, *, max_display=10, feature_names=None, abbreviate=True, alpha=0.8, row_height=0.4, ax=None, rng_seed=42, show=True)[source]ΒΆ
Plots a beeswarm plot of SHAP-IQ interaction values. Based on the SHAP beeswarm plot.
The beeswarm plot visualizes how the magnitude and direction of interaction effects are distributed across all samples in the data, revealing dependencies between the featureβs value and the strength of the interaction.
- Parameters:
interaction_values_list (
list[InteractionValues]) β A list containing InteractionValues objects.data (
DataFrame|ndarray) β The input data used to compute the interaction values.max_display (
int|None) β Maximum number of interactions to display. Defaults to 10.feature_names (
list[str] |None) β Names of the features. If not given, feature indices will be used. Defaults toNone.abbreviate (
bool) β Whether to abbreviate feature names. Defaults toTrue.alpha (
float) β The transparency level for the plotted points, ranging from 0 (transparent) to 1 (opaque). Defaults to 0.8.row_height (
float) β The height in inches allocated for each row on the plot. Defaults to 0.4.ax (
Axes|None) βMatplotlib Axesobject to plot on. IfNone, a new figure and axes will be created.rng_seed (
int|None) β Random seed for reproducibility. Defaults to 42.show (
bool) β Whether to show the plot. Defaults toTrue. IfFalse, the function returns the axis of the plot.
- Return type:
- Returns:
If
showisFalse, the function returns the axis of the plot. Otherwise, it returnsNone.