shapiq.plot.force_plotΒΆ

shapiq.plot.force_plot(interaction_values, *, feature_names=None, abbreviate=True, show=False, figsize=(15, 4), draw_higher_lower=True, contribution_threshold=0.05)[source]ΒΆ

Draws a force plot for the given interaction values.

Parameters:
  • interaction_values (InteractionValues) – The InteractionValues to be plotted.

  • feature_names (ndarray | list[str] | None) – The names of the features. If None, the features are named by their index.

  • show (bool) – Whether to show or return the plot. Defaults to False and returns the plot.

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

  • figsize (tuple[int, int]) – The size of the figure. Defaults to (15, 4).

  • draw_higher_lower (bool) – Whether to draw the higher and lower indicator. Defaults to True.

  • contribution_threshold (float) – Define the minimum percentage of the total effect that a feature must contribute to be shown in the plot. Defaults to 0.05.

Returns:

The figure of the plot

Return type:

Figure | None