shapiq.plot.waterfall_plotΒΆ

shapiq.plot.waterfall_plot(interaction_values, *, feature_names=None, show=False, max_display=10, abbreviate=True)[source]ΒΆ

Draws a waterfall plot with the interaction values.

The waterfall plot shows the individual contributions of the features to the interaction values. The plot is based on the waterfall plot from the SHAP package.

Parameters:
  • interaction_values (InteractionValues) – The interaction values as an interaction object.

  • feature_names (ndarray | list[str] | None) – The names of the features. Defaults to None. To display feature values alongside feature names, provide strings in the format "value=feature" (e.g., "25=Age"). The plot will show the value in gray and the feature name in black.

  • show (bool) – Whether to show the plot. Defaults to False.

  • max_display (int) – The maximum number of interactions to display. Defaults to 10.

  • abbreviate (bool) – Whether to abbreviate the feature names. Defaults to True.

Return type:

Axes | None

Returns:

The plot if show is False.