The following code works with v0.12.2, but fails with v0.13.
import catboost
from catboost import *
import shap
X,y = shap.datasets.boston()
model = CatBoostRegressor(iterations=300, learning_rate=0.1, random_seed=123)
model.fit(X, y, verbose=False, plot=False)
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)
Error:
Traceback (most recent call last):
File "shtest.py", line 9, in <module>
shap_values = explainer.shap_values(X)
File "<..>/.local/lib/python3.6/site-packages/shap/explainers/tree.py", line 197, in shap_values
if len(phi.shape) == 3:
AttributeError: 'list' object has no attribute 'shape'
catboost version: v0.13
Operating System: GNU Linux
CPU: x64
Working on that right now, release with fix will come out shortly.
Do I understand correctly that this was this fixed in v0.13.1?
Do I understand correctly that this was this fixed in v0.13.1?
Yes, you're right, closing the issue.
Most helpful comment
Working on that right now, release with fix will come out shortly.