Skip to content

Updated Shap saving. #881

Merged
RobertSamoilescu merged 2 commits intoSeldonIO:masterfrom
RobertSamoilescu:fix/shap-saving
Mar 1, 2023
Merged

Updated Shap saving. #881
RobertSamoilescu merged 2 commits intoSeldonIO:masterfrom
RobertSamoilescu:fix/shap-saving

Conversation

@RobertSamoilescu
Copy link
Contributor

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
_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