Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Error: cannot import name 'Kernel' #48

Open
ViniMelloeMuller opened this issue Oct 19, 2023 · 4 comments · May be fixed by #58
Open

Import Error: cannot import name 'Kernel' #48

ViniMelloeMuller opened this issue Oct 19, 2023 · 4 comments · May be fixed by #58

Comments

@ViniMelloeMuller
Copy link

Hello, i'm working on a project using timeSHAP (timeshap==1.0.4) and i'm getting ImportError when:

from timeshap.explainer import local_report

It says:

ImportError: cannot import name 'Kernel' from 'shap.explainers._kernel'

My shap version is (shap==0.43.0). Thanks in advance

@OverGreenWaters
Copy link

had the same issue.
had to downgrade the shap version (e.g. 0.37.0)

@kevduc
Copy link

kevduc commented Nov 22, 2023

Looks like Kernel got recently renamed to KernelExplainer, shap/shap@ca08229#diff-7ac25c0cf4216cbad9d7079e83c9c36fea1de8413f8fc7460d1b32af21d1fbc2R38

I've renamed it in timeshap in these 2 places and it seems to work:

@drorhunvural
Copy link

Looks like Kernel got recently renamed to KernelExplainer, shap/shap@ca08229#diff-7ac25c0cf4216cbad9d7079e83c9c36fea1de8413f8fc7460d1b32af21d1fbc2R38

I've renamed it in timeshap in these 2 places and it seems to work:

Same issue.

Even after changing the Kernel name in timeshap_kernel.py to KernelExplainer as suggested, the problem persists. Is there any update or further guidance available?

@Corkman99
Copy link

Maybe the merge was not pushed? The code still has 'Kernel' instead of 'KernelExplainer'

@AndreFCruz AndreFCruz linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants