KernelShap
returns no explanations when link='logit'
and predicted proba is 0 or 1
#952
Labels
KernelShap
returns no explanations when link='logit'
and predicted proba is 0 or 1
#952
Issue
When the
KernelShap
explainer is configured withlink='logit'
, and thepredictor
returns probabilities of0
or1
, thelogit
link function raises errors due tologit(0) = -inf
andlogit(1) = inf
.Example error:
This is a problem when batches of instances are passed to
explain
, because the errors raised by problem instances result in no instances being returned, even for instances where0 > proba < 1
.Solution
When
link='logit'
, we could patch the logit link function with something like:This would allow the explanations to run for instances who's predicted proba's are
0 < proba < 1
. Problematic instances would just havenp.nan
explanations returned. For example:Related issues
The text was updated successfully, but these errors were encountered: