Catboost: shap values broken in v0.13

Created on 14 Mar 2019  路  3Comments  路  Source: catboost/catboost

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

bug in progress

Most helpful comment

Working on that right now, release with fix will come out shortly.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings