Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Included warning TreeSHAP background dataset size. #710

Merged
merged 3 commits into from
Jul 4, 2022

Conversation

RobertSamoilescu
Copy link
Collaborator

@RobertSamoilescu RobertSamoilescu commented Jun 29, 2022

This PR addresses the issue #704. It warns the user that TreeShap supports only up to 100 (TREE_SHAP_BACKGROUND_SUPPORTED_SIZE) samples in the background dataset. Note that there is a logic related to the summarisation of the background dataset which uses 1000(TREE_SHAP_BACKGROUND_WARNING_THRESHOLD) as (warning) threshold. Although the TREE_SHAP_BACKGROUND_WARNING_THRESHOLD > TREE_SHAP_BACKGROUND_SUPPORTED_SIZE which might be contradictory, we leave that logic untouched. This approach has at least two benefits:

  • minimal refactoring
  • return the correct result if a newer version of shap which fixes the issue is used before we update our dependencies in alibi (i.e. just ignore the warning)

@RobertSamoilescu RobertSamoilescu requested a review from jklaise June 29, 2022 09:16
@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #710 (58ee40d) into master (efac30c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #710   +/-   ##
=======================================
  Coverage   80.55%   80.55%           
=======================================
  Files         105      105           
  Lines       11790    11794    +4     
=======================================
+ Hits         9497     9501    +4     
  Misses       2293     2293           
Impacted Files Coverage Δ
alibi/explainers/shap_wrappers.py 89.32% <100.00%> (+0.08%) ⬆️

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants