dsgibbons / shap

A game theoretic approach to explain the output of any machine learning model.
https://shap-community.readthedocs.io/en/latest/
MIT License
25 stars 5 forks source link

fix: ruff rule F841 (unused variable) #90

Closed thatlittleboy closed 1 year ago

thatlittleboy commented 1 year ago

Related to Issue https://github.com/dsgibbons/shap/issues/21, and is a continuation of PR https://github.com/dsgibbons/shap/pull/25 when ruff was initially introduced to the project.

This PR aims to make the codebase F841-compliant ("Local variables assigned but unused").

For the variables with no clear purpose, I removed them. Some I chose to keep/comment away (somewhat arbitrary decision based on a feeling that it might be useful for future reference, feel free to tell me to delete them).

Dependencies: The hstack bug of Explanation makes an appearance here too. So PR #86 should be merged in first. ✅ DONE

codecov[bot] commented 1 year ago

Codecov Report

Merging #90 (64a283d) into master (2cabb07) will decrease coverage by 0.02%. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
- Coverage   53.65%   53.63%   -0.02%     
==========================================
  Files          90       90              
  Lines       12981    12957      -24     
==========================================
- Hits         6965     6950      -15     
+ Misses       6016     6007       -9     
Impacted Files Coverage Δ
shap/_explanation.py 55.68% <ø> (+0.02%) :arrow_up:
shap/plots/_beeswarm.py 53.78% <ø> (+0.02%) :arrow_up:
shap/plots/_image.py 73.04% <ø> (-0.47%) :arrow_down:
shap/plots/_scatter.py 26.62% <0.00%> (ø)
shap/plots/_text.py 54.48% <ø> (-0.15%) :arrow_down:
shap/plots/_violin.py 76.26% <ø> (+0.40%) :arrow_up:
shap/utils/_general.py 64.82% <ø> (+0.32%) :arrow_up:
shap/plots/_bar.py 56.33% <50.00%> (ø)
shap/explainers/_sampling.py 89.18% <100.00%> (+0.69%) :arrow_up:
shap/plots/_waterfall.py 83.54% <100.00%> (+0.31%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more