lime icon indicating copy to clipboard operation
lime copied to clipboard

LIME explainer not working for Logistic Classifier

Open jgdpsingh opened this issue 3 years ago • 0 comments

I'm using Logistic Classifier on a categorical dataset and after I did everything right, I got the following error:

NotImplementedError Traceback (most recent call last) /tmp/ipykernel_33/3771634090.py in 2 k=5 3 exp_lime = explainer.explain_instance( ----> 4 X_test2[i], lr.predict, num_features=k)

/opt/conda/lib/python3.7/site-packages/lime/lime_tabular.py in 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 "

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

Logistic Classifier does support probability scores

jgdpsingh avatar Apr 02 '22 10:04 jgdpsingh