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

background/filter dataset in LIME #704

Open
BinDong314 opened this issue Nov 10, 2022 · 1 comment
Open

background/filter dataset in LIME #704

BinDong314 opened this issue Nov 10, 2022 · 1 comment

Comments

@BinDong314
Copy link

Hi LIME community,
Thanks for the help or any lead in advance.

One thing we are looking for is to provide a background data for LIME at the time of explanation of every instance.
We are not sure if it is available in LIME?
More specifically, it looks like the shap.KernelExplainer' data parameter.
https://shap-lrjball.readthedocs.io/en/latest/generated/shap.KernelExplainer.html

One possible method is to provide feature_selection (e.g, highest_weights) for LimeTabularExplainer or explain_instance_with_data.
But, it looks like LimeTabularExplainer needs to build the explainer for every instance, and explain_instance_with_data needs users to provide neighborhood_data etc.

Bests,
Bin

@BinDong314
Copy link
Author

Created a pull request here to address my issue. Please help to review it.

#705

Some note:

Add predict_fn_accept_dense_only to explain_instance.

When data_row (of explain_instance) is scipy.sparse.matrix but the model was NOT trained with scipy.sparse.matrix, the predict_fn_accept_dense_only convert inverse to dense before call predict_fn (and then back to sparse after call predict_fn)

Bin dbin@lbl.gov

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

No branches or pull requests

1 participant