deepof.visuals.plot_shap_swarm_per_cluster

deepof.visuals.plot_shap_swarm_per_cluster(coordinates: deepof_coordinates, data_to_explain: DataFrame, shap_values: list, cluster: str | int = 'all', max_display: int = 10, save: str = False, show: bool = True)

Plot a swarm plot of the SHAP values for a given cluster.

Parameters:
  • coordinates (coordinates) – deepOF project where the data is stored.

  • data_to_explain (pd.DataFrame) – table with descriptive statistics for a series of sequences (‘chunks’).

  • shap_values (list) – shap_values per cluster.

  • cluster (int) – cluster to plot. If “all” (default) global feature importance across all clusters is depicted in a bar chart.

  • max_display (int) – maximum number of features to display.

  • save (str) – if provided, saves the figure to the specified file.

  • show (bool) – if True, shows the figure.