marcotcr / lime

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

Lime value and feature importance are inconsistent with different random seed #683

Open sweta30 opened 1 year ago

sweta30 commented 1 year ago

While using the iris dataset, I tried to generate LIME values for features with a different random seed and got inconsistency in LIME values and feature importance between each run. So wanted to raise a concern about its reliability. I have uploaded two screenshots from my observation.

sample used for explanation : 5.5 , 3.5 , 1.3 , 0.2

First Run test1

Second Run test2

sharmajee499 commented 1 year ago

There are various places in the algorithms that use random numbers. If one doesn't use a consistent random_seed() value, it is obvious to get different results while running with the same parameter or hyperparameters. So, it is unsurprising if you got different results from different random seeds. I would suggest checking this article for more info. I hope this answers your question.