BUG: TreeExplainer ignores "link" argument passed by the Explainer API
connortann opened this issue · 1 comments
The current implementation of TreeExplainer entirely ignores the link
and linearize_link
arguments which are passed from Explainer
here:
shap/shap/explainers/_explainer.py
Line 188 in b3573bd
They are currently caught by the "deprecated options" catchall, and subsequently ignored:
Lines 63 to 72 in b3573bd
This seems rather concerning. It's not obvious to me where precisely the link function should be applied in TreeExplainer, if at all. As far as I can make out, the TreeExplainer uses the "model_output" inferred from the explained model rather than the user-defined "link" variable.
The link function is there since non-linear transformations of the shap values will break additivity because
Hmm, not sure where it should be applied, usually one hands the link over to the masker. Will need to take another look but wanted to note this here.
Edit: I guess the link function/linearized_link should be applied before checking additivity and nowhere else.