baybe.insights.shap.make_explainer_for_surrogate¶
- baybe.insights.shap.make_explainer_for_surrogate(surrogate: Surrogate, data: DataFrame, explainer_cls: type[Explainer] | str = 'KernelExplainer', *, use_comp_rep: bool = False)[source]¶
Create a SHAP explainer for a given surrogate model.
- Parameters:
- Return type:
- Returns:
The created explainer object.
- Raises:
ValueError – If the provided background data set is empty.
TypeError – If the provided explainer class is incompatible with the surrogate.