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

Problems with implementing LIME, can't get binary 0 or 1 outputs, only probabilities #706

Open
Ostlimpa opened this issue Dec 8, 2022 · 0 comments

Comments

@Ostlimpa
Copy link

Ostlimpa commented Dec 8, 2022

Hope everyone is holding on tight, we're soon at Christmas!

Hi, as I have already made a post about the issue in detail over at stackexchange, I'll just post the link here and a quick summary of my problem:

Link here: https://datascience.stackexchange.com/questions/116799/problems-with-implementing-lime?noredirect=1#comment117787_116799

My problem is that I want to show my random forest score through the predict.proba(x_test)[:, 1] method. However, it gives me this error code when I try use LIME to show the score using that prediction:

Cell In [31], line 3
1 i = 49
----> 3 exp = explainer.explain_instance(x_test.iloc[i], predict_fn_rf, num_features=5)
4 exp.show_in_notebook(show_table=True)

File ~\OneDrive\Documents\Anaconda\lib\site-packages\lime\lime_tabular.py:361, in LimeTabularExplainer.explain_instance(self, data_row, predict_fn, labels, top_labels, num_features, num_samples, distance_metric, model_regressor)
359 if self.mode == "classification":
360 if len(yss.shape) == 1:
--> 361 raise NotImplementedError("LIME does not currently support "
362 "classifier models without probability "
363 "scores. If this conflicts with your "
364 "use case, please let us know: "
365 "https://github.com/datascienceinc/lime/issues/16")
366 elif len(yss.shape) == 2:
367 if self.class_names is None:

NotImplementedError: LIME does not currently support classifier models without probability scores. If this conflicts with your use case, please let us know: https://github.com/datascienceinc/lime/issues/16

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