plot_shap_bar

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

plot_shap_bar(shap_values: ndarray, features: ndarray, *, feature_names: Sequence[str] | None = None, title: str = 'SHAP bar', max_display: int = 20, base_value: float = 0.0)[source]

Global mean-absolute SHAP bar chart (shap.plots.bar).

Parameters:
  • shap_values – Attribution matrix (n_samples, n_features).

  • features – Feature matrix aligned with shap_values.

  • feature_names – Optional column names (ASCII-sanitised on draw).

  • title – Figure title (sanitised).

  • max_display – Maximum number of features to show.

  • base_value – Explainer base value stored on the Explanation.

Returns:

The matplotlib Figure.