Explainer: SHAP Tree

class xaicompare.adapters.explainers.explainer_shap_tree.ShapTreeExplainerAdapter(model_adapter, config: Dict[str, Any])[source]

Bases: ExplainerAdapter

SHAP Tree Explainer with:
  • Safe sparse handling

  • Forced vectorization

  • Guaranteed 2-D input to SHAP

  • Batch processing to avoid memory errors

  • Multi-class normalization

_abc_impl = <_abc._abc_data object>
global_importance(X, rows_limit: int = 200) Tuple[ndarray, List[str]][source]

Compute mean|SHAP| across first rows_limit samples safely.

limitation_text()[source]
local_explanations(x_row) ndarray[source]

Compute SHAP for a single example → return signed vector.