You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a tree/tabular model backend (sklearn / XGBoost / LightGBM) so SHAP TreeExplainer runs end-to-end. TreeExplainer is already registered but unusable: no backend loads a tree model, and it needs the raw fitted estimator, not an nn.Module.
Blocked by #209 (make the model-module explanation contract backend-agnostic). TreeExplainer needs structural access to the tree (splits, leaf values), which the current nn.Module-shaped explanation contract cannot express. The agnostic contract from #209 is the prerequisite.
What exists
MethodFamily.TREE defined — src/raitap/transparency/contracts.py:104
TreeExplainer registered in the SHAP adapter, tagged {SHAPLEY, TREE} — src/raitap/transparency/explainers/shap_explainer.py:113
It carries a behavior-preserving placeholder requires=frozenset({Capability.AUTOGRAD}) — wrong capability, kept only because nothing provides TREE_MODEL yet
Capability.TREE_MODEL pre-seeded as a roadmap member, no provider/requirer yet — src/raitap/types.py
The image visualiser explicitly rejects it — src/raitap/transparency/tests/test_methods.py:74
Add a tree/tabular backend that declares @backends.register(provides=frozenset({Capability.TREE_MODEL})) (add PREDICT_PROBA if it exposes probabilities). See docs/contributor/adding-a-backend.md. It returns the fitted estimator through the agnostic explanation contract from Make the model-module explanation contract backend-agnostic (drop the nn.Module bridge) #209 (no nn.Module facade).
Flip TreeExplainer from requires={AUTOGRAD} to requires={Capability.TREE_MODEL}. The capability gate then rejects it cleanly on torch/onnx (clear BackendIncompatibilityError) and routes it only to the tree backend.
Reconcile the backend's __call__ / prediction semantics with the pipeline: tree models emit probabilities/labels, not logits, while the forward pass + argmax-predictions path assumes logits. Decide how predictions and metrics behave over tree outputs.
Choose a suitable visualiser for tree attributions (the image visualiser rejects TreeExplainer today).
Acceptance criteria
TreeExplainer runs end-to-end on a real tree model via a documented tree backend.
requires reflects the true capability (TREE_MODEL, not the AUTOGRAD placeholder).
Selecting TreeExplainer on a non-tree backend raises a clear BackendIncompatibilityError, not a SHAP-internal failure.
Predictions/metrics behave sensibly for tree-model outputs.
Docs reflect the actually supported explainability methods + the new backend.
Summary
Add a tree/tabular model backend (sklearn / XGBoost / LightGBM) so SHAP
TreeExplainerruns end-to-end.TreeExplaineris already registered but unusable: no backend loads a tree model, and it needs the raw fitted estimator, not annn.Module.Blocked by #209 (make the model-module explanation contract backend-agnostic).
TreeExplainerneeds structural access to the tree (splits, leaf values), which the currentnn.Module-shaped explanation contract cannot express. The agnostic contract from #209 is the prerequisite.What exists
MethodFamily.TREEdefined —src/raitap/transparency/contracts.py:104TreeExplainerregistered in the SHAP adapter, tagged{SHAPLEY, TREE}—src/raitap/transparency/explainers/shap_explainer.py:113requires=frozenset({Capability.AUTOGRAD})— wrong capability, kept only because nothing providesTREE_MODELyetCapability.TREE_MODELpre-seeded as a roadmap member, no provider/requirer yet —src/raitap/types.pysrc/raitap/transparency/tests/test_methods.py:74Tasks (after #209 lands)
@backends.register(provides=frozenset({Capability.TREE_MODEL}))(addPREDICT_PROBAif it exposes probabilities). Seedocs/contributor/adding-a-backend.md. It returns the fitted estimator through the agnostic explanation contract from Make the model-module explanation contract backend-agnostic (drop the nn.Module bridge) #209 (nonn.Modulefacade).TreeExplainerfromrequires={AUTOGRAD}torequires={Capability.TREE_MODEL}. The capability gate then rejects it cleanly on torch/onnx (clearBackendIncompatibilityError) and routes it only to the tree backend.__call__/ prediction semantics with the pipeline: tree models emit probabilities/labels, not logits, while the forward pass + argmax-predictions path assumes logits. Decide how predictions and metrics behave over tree outputs.TreeExplainertoday).Acceptance criteria
TreeExplainerruns end-to-end on a real tree model via a documented tree backend.requiresreflects the true capability (TREE_MODEL, not theAUTOGRADplaceholder).TreeExplaineron a non-tree backend raises a clearBackendIncompatibilityError, not a SHAP-internal failure.