Skip to content

Commit

Permalink
Merge pull request #552 from guillaume-vignal/fix/shap_0.45.0
Browse files Browse the repository at this point in the history
Fix/shap 0.45.0
  • Loading branch information
guillaume-vignal authored May 6, 2024
2 parents c891f16 + 1b1789a commit efdb5db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dash-table==5.0.0
lightgbm==2.3.1
pandas>=2.1.0
plotly==5.6.0
shap>=0.38.1,<0.45.0
shap>=0.45.0
Sphinx==4.5.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"matplotlib>=3.2.0",
"numpy>1.18.0",
"pandas>=2.1.0",
"shap>=0.38.1,<0.45.0",
"shap>=0.45.0",
"Flask<2.3.0",
"dash>=2.3.1",
"dash-bootstrap-components>=1.1.0",
Expand Down
5 changes: 4 additions & 1 deletion tests/integration_tests/test_contributions_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def test_rank_contributions_1(self):
model.fit(self.x_train, self.y_train)
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(self.x_test)
slist = [pd.DataFrame(data=tab, index=self.x_test.index, columns=self.x_test.columns) for tab in shap_values]
slist = [
pd.DataFrame(data=shap_values[:, :, i], index=self.x_test.index, columns=self.x_test.columns)
for i in range(3)
]

for i in range(3):
s_ord, x_ord, s_dict = rank_contributions(slist[i], pd.DataFrame(data=self.x_test))
Expand Down

0 comments on commit efdb5db

Please sign in to comment.