-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Shap saving. #881
Updated Shap saving. #881
Conversation
…ids saving internal explainer.
4a95d59
to
a21778b
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #881 +/- ##
=======================================
Coverage 85.30% 85.31%
=======================================
Files 74 74
Lines 8774 8779 +5
=======================================
+ Hits 7485 7490 +5
Misses 1289 1289
Flags with carried forward coverage won't be shown. Click here to find out more.
|
alibi/saving.py
Outdated
|
||
def _save_KernelShap(explainer: 'KernelShap', path: Union[str, os.PathLike]) -> None: | ||
_save_Shap(explainer, path) | ||
|
||
|
||
def _save_TreelShap(explainer: 'TreeShap', path: Union[str, os.PathLike]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that the function name had a typo, probably good to fix now.
# set the internal explainer object to avoid saving it. The internal explainer | ||
# object is recreated when in the `reset_predictor` function call. | ||
_explainer = explainer._explainer | ||
explainer._explainer = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that this will need to be considered too when fixing #830
Fixes savings for distributed
KernelShap
and avoids saving internal explainer.