Skip to content

Commit

Permalink
Merge: Insights User Guide (#466)
Browse files Browse the repository at this point in the history
A user guide explaining the recent addition of insights / `SHAPInsight`

[Fork
deployment](https://scienfitz.github.io/baybe-dev/latest/userguide/insights.html)

I've not made the pictures transparent. It would likely make the dark
version unreadable and with white background the light version looks
good and the dark version looks still `OKish`.

The pictures together are 288 kB
  • Loading branch information
Scienfitz authored Jan 28, 2025
2 parents a885b7a + 3825855 commit 71d9cf0
Show file tree
Hide file tree
Showing 10 changed files with 9,113 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Optional `insights` dependency group
- Insights user guide
- SHAP explanations via the new `SHAPInsight` class
- `allow_missing` and `allow_extra` keyword arguments to `Objective.transform`
- Example for a traditional mixture
Expand Down
7 changes: 7 additions & 0 deletions baybe/insights/shap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@
"PartitionExplainer",
"PermutationExplainer",
}
"""Supported SHAP explainer types for :class:`baybe.insights.shap.SHAPInsight`"""

NON_SHAP_EXPLAINERS = {"LimeTabular", "Maple"}
"""Supported non-SHAP explainer types for :class:`baybe.insights.shap.SHAPInsight`"""

EXPLAINERS = SHAP_EXPLAINERS | NON_SHAP_EXPLAINERS
"""Supported explainer types for :class:`baybe.insights.shap.SHAPInsight`"""

SHAP_PLOTS = {"bar", "beeswarm", "force", "heatmap", "scatter"}
"""Supported plot types for :meth:`baybe.insights.shap.SHAPInsight.plot`"""


def _get_explainer_cls(name: str) -> type[shap.Explainer]:
Expand Down
Loading

0 comments on commit 71d9cf0

Please sign in to comment.