tabensemb.model.AutoGluon.cal_shap#
method
- AutoGluon.cal_shap(model_name: str, return_importance: bool = True, n_background: int = 10, explainer: str = 'KernelExplainer', init_kwargs: Dict | None = None, call_kwargs: Dict | None = None, indices: Iterable | None = None, **kwargs) ndarray#
Calculate SHAP values using a specified model.
shap.kmeansis called to summarize the training data as the background data.- Parameters:
- model_name
The selected model in the model base.
- return_importance
- True to return mean absolute SHAP values. False to return
shap.Explainer,shap.Explanation, and results of :meth:
shap.Explainer.shap_values
- True to return mean absolute SHAP values. False to return
- n_background
Number of background data passed to
shap.Explainerasdata.- indices
The indices of data points where shap values are evaluated
- explainer
The name of an explainer available at shap.
- init_kwargs
Arguments of
explainer.__init__- call_kwargs
Arguments of ``explainer.__call__`
- kwargs
Ignored.
- Returns:
- attr
The SHAP values.