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: Explanation hstack undefined name error #86

Closed thatlittleboy closed 1 year ago

thatlittleboy commented 1 year ago

Part of #54.

  1. Explanation.hstack method was using a non-existent variable "axis" (probably copied from the other helper methods like sum). The implementation as it is didn't make any sense, so I modified it to what I think made the most sense, which is to hstack the inner arrays and return a new Explanation object.
  2. Added tests for hstack only.
codecov[bot] commented 1 year ago

Codecov Report

Merging #86 (8179889) into master (3213a3b) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
+ Coverage   52.22%   52.25%   +0.03%     
==========================================
  Files          90       90              
  Lines       13146    13146              
==========================================
+ Hits         6866     6870       +4     
+ Misses       6280     6276       -4     
Impacted Files Coverage Δ
shap/_explanation.py 55.66% <100.00%> (+0.79%) :arrow_up:

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