Closed databill86 closed 3 years ago
I haven't tried Lime so I'm afraid I can't give you any concrete examples. What do you mean by weird results though?
The results seem to be random, they change every time I rerun the explainer.
I can't see anything wrong with the code itself. Do the predictions change every time you run it as well?
Hi @databill86
Did you figure out the problem? Were you able to run LIME with simple transformers? If yes, please let us know.
Thanks
Hi @iknoorjobs,
No still the same issue, the results are still not stable. I'm not sure I'm doing it right : In the call of explainer.explain_instance, i'm passing num_samples=len(text.split()), I'm not sure if this is right. I did because if was the only way to make it work.
@databill86 @iknoorjobs I think you should increase num_samples
to something around 100. The way LIME works is it tries to build interpretable models to explain predictions and those interpretable models are built using num_samples
samples. If the num_samples is too low, variance is expected in those interpretable models. It should work out fine after this change.
@databill86 @iknoorjobs I think you should increase
num_samples
to something around 100. The way LIME works is it tries to build interpretable models to explain predictions and those interpretable models are built usingnum_samples
samples. If the num_samples is too low, variance is expected in those interpretable models. It should work out fine after this change.
@goru001 Thanks for the update.
Is this solved now?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug Actually this is not a bug. I created a ClassificationModel with 4 classes, and tried to explain the results with LIME. I'm having weird results, so I just want to check if my method was correct.
Here is the code :
Then with Lime:
I did find some solutions on how to use Lime with BERT, but I guess it is not the same thing with simpletransformers. There is an example here : https://github.com/marcotcr/lime/issues/409
Thank you !