timeshap icon indicating copy to clipboard operation
timeshap copied to clipboard

Lack support for shap > 0.42.1

Open daniegr opened this issue 3 months ago • 0 comments

Due to renaming of explainers in shap 0.43.0, TimeSHAP logic fails when the default pip install is used:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[24], line 1
----> 1 from timeshap.explainer import local_report
      3 pruning_dict = {'tol': 0.025}
      4 event_dict = {'rs': 42, 'nsamples': 32000}

File ~\anaconda3\envs\env\lib\site-packages\timeshap\explainer\__init__.py:15
      1 #  Copyright 2022 Feedzai
      2 #
      3 #  Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 #  See the License for the specific language governing permissions and
     13 #  limitations under the License.
---> 15 from .kernel import *
     16 from .pruning import *
     17 from .event_level import *

File ~\anaconda3\envs\env\lib\site-packages\timeshap\explainer\kernel\__init__.py:15
      1 #  Copyright 2022 Feedzai
      2 #
      3 #  Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 #  See the License for the specific language governing permissions and
     13 #  limitations under the License.
---> 15 from .timeshap_kernel import TimeShapKernel

File ~\anaconda3\envs\env\lib\site-packages\timeshap\explainer\kernel\timeshap_kernel.py:53
     51 from shap.utils._legacy import convert_to_link, IdentityLink
     52 from shap.utils._legacy import convert_to_instance, convert_to_model
---> 53 from shap.explainers._kernel import Kernel
     54 from scipy.special import binom
     55 from scipy.sparse import issparse

ImportError: cannot import name 'Kernel' from 'shap.explainers._kernel' (C:\Users\user\anaconda3\envs\env\lib\site-packages\shap\explainers\_kernel.py)

daniegr avatar Mar 20 '24 14:03 daniegr