Skip to content

Commit efdb5db

Browse files
Merge pull request #552 from guillaume-vignal/fix/shap_0.45.0
Fix/shap 0.45.0
2 parents c891f16 + 1b1789a commit efdb5db

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

requirements.dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dash-table==5.0.0
1313
lightgbm==2.3.1
1414
pandas>=2.1.0
1515
plotly==5.6.0
16-
shap>=0.38.1,<0.45.0
16+
shap>=0.45.0
1717
Sphinx==4.5.0
1818
sphinxcontrib-applehelp==1.0.2
1919
sphinxcontrib-devhelp==1.0.2

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"matplotlib>=3.2.0",
2222
"numpy>1.18.0",
2323
"pandas>=2.1.0",
24-
"shap>=0.38.1,<0.45.0",
24+
"shap>=0.45.0",
2525
"Flask<2.3.0",
2626
"dash>=2.3.1",
2727
"dash-bootstrap-components>=1.1.0",

tests/integration_tests/test_contributions_multiclass.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def test_rank_contributions_1(self):
9797
model.fit(self.x_train, self.y_train)
9898
explainer = shap.TreeExplainer(model)
9999
shap_values = explainer.shap_values(self.x_test)
100-
slist = [pd.DataFrame(data=tab, index=self.x_test.index, columns=self.x_test.columns) for tab in shap_values]
100+
slist = [
101+
pd.DataFrame(data=shap_values[:, :, i], index=self.x_test.index, columns=self.x_test.columns)
102+
for i in range(3)
103+
]
101104

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

0 commit comments

Comments
 (0)