Skip to content
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

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

RobertSamoilescu
Copy link
Collaborator

Fixes savings for distributed KernelShap and avoids saving internal explainer.

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #881 (a21778b) into master (58eaa34) will increase coverage by 0.00%.
The diff coverage is 85.71%.

❗ Current head a21778b differs from pull request most recent head db0a05e. Consider uploading reports for the commit db0a05e to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #881   +/-   ##
=======================================
  Coverage   85.30%   85.31%           
=======================================
  Files          74       74           
  Lines        8774     8779    +5     
=======================================
+ Hits         7485     7490    +5     
  Misses       1289     1289           
Flag Coverage Δ
macos-latest-3.10 ?
ubuntu-latest-3.10 85.18% <85.71%> (+<0.01%) ⬆️
ubuntu-latest-3.7 85.08% <85.71%> (+<0.01%) ⬆️
ubuntu-latest-3.8 85.20% <85.71%> (+<0.01%) ⬆️
ubuntu-latest-3.9 85.20% <85.71%> (+<0.01%) ⬆️
windows-latest-3.9 82.85% <85.71%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
alibi/saving.py 82.90% <85.71%> (+0.37%) ⬆️

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:
Copy link
Contributor

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
Copy link
Contributor

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

@RobertSamoilescu RobertSamoilescu merged commit 3594f71 into SeldonIO:master Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants