linkedin / FastTreeSHAP

Fast SHAP value computation for interpreting tree-based models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot slice shap values like SHAP package

chinaidf opened this issue · comments

Hi, I am using fasttreeshap v0.1.6 package to calculate the shap values of my random forest model. It really accelerate the shap value calculation substantially. However, when I tried to produce the scatter or dependence plots, I cannot extract a single column of the shap values (e.g., shap_values[:, 0] or shap_values[:, feature1]). I got an IndexError: index 1 is out of bounds for axis 1 with size 1.

I have re-created the shap Explanation object and I found the base_values array is a 2-dimensional array but the SHAP-generated base_values is a 1-dimensional array. I have squeezed the base_values array and the error is corrected.