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: violin plots tests #87

Closed thatlittleboy closed 1 year ago

thatlittleboy commented 1 year ago

part of #54 .

  1. I revampedviolin plot code quite a bit. The original violin was essentially a copy-paste from the summary_legacy() function, so there's a lot of redundant code (including a call to a "non-existent" summary() function) checking for "bar" or "dot" plot types. These have all been removed. Violin plots don't support multioutputs (only bar plots support this), so that section has been removed as well.
    • I'll note that the code for violin is still in the "legacy" style. For e.g., it still accepts shap_values as a numpy array. Whereas beeswarm only takes in Explanation objects, which I think we should align to that convention. -> Issue #55.
  2. The plot tests for violin in test_violin.py and test_summary.py were revamped. In particular, the original test was just an empty plot...
codecov[bot] commented 1 year ago

Codecov Report

Merging #87 (388fdda) into master (3213a3b) will increase coverage by 1.13%. The diff coverage is 81.25%.

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   52.22%   53.36%   +1.13%     
==========================================
  Files          90       90              
  Lines       13146    13028     -118     
==========================================
+ Hits         6866     6952      +86     
+ Misses       6280     6076     -204     
Impacted Files Coverage Δ
shap/plots/_violin.py 75.86% <80.00%> (+54.98%) :arrow_up:
shap/plots/_beeswarm.py 49.18% <100.00%> (-0.19%) :arrow_down:

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