marcotcr / lime

Lime: Explaining the predictions of any machine learning classifier
BSD 2-Clause "Simplified" License
11.5k stars 1.79k forks source link

lime labels differ from Keras model predictions #578

Closed giuliaass closed 3 years ago

giuliaass commented 3 years ago

I'm working on a Text classification Problem with Keras and lime. I'm using neural networks and word embeddings.

Afterwards I want to explain my model with lime. When I use lime to explain the first three sentences of the test data lime predicts for me the following labels: 1 0 1 1 0 1. But my Keras model predicts: 1 0 1 1 1 1 Also the probabilities for label 1 or label 0 differ for the Keras model and the lime output.

Why is this the case or is there something wrong with my model?

Thank you in advance!

marcotcr commented 3 years ago

Make sure your model takes in a list rather than a single example. If it doesn't work, please open a new issue with a code sample.