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
Regression: Reproducability of Explanations #199
Comments
I think this is due to the randomness of the perturbations around the test input( the input you need the explanation for). The way to reduce the variance is to calculate the mean feature importance over n(=100) runs. Please let me know your thoughts. Thanks, |
Hi @chirjeev94 , thanks for your reply. My assumption would be, that setting If this does not referr to a single explanation, I would expect, that I could avoid randomness by supplying the I would like to have reproducability e.g. in order to exchange projects with colleagues. |
While setting random_state in the constructor makes it easy to reproduce a whole experiment exactly, it does not mean the random state is reset at each explanation, as you noted. |
Hello all, I've recently started using LIME and have run into the same reproduciblity issue. As mentioned above, passing the The way I understand how lime works, is that if random seed is set to a given number, then every time the code is run, the same perturbed points are selected. Therefore, the distance dependent weight of each point and everything else should be the same as well. So we are regressing on the same points using the same parameters every time. I pass on the Sklearn |
The same for me. Did you find the solution? |
I couldn't get it to work with this LIME package so ended up writing my own LIME implementation. Having said that, the correct way to use LIME is to do it in an iterative manner where you increase the number of perturbation points at every iteration until the weights converge. It's computationally expensive and very susceptible to the curse of dimensionality but that's how one is supposed to use it. In that case, you are less likely to run into the problem of different explanations every time you run the code. |
@fnasiri-gannett Dear Farshad, Would you please send me your LIME implementation, which produces the same output(explanations) for same inputs? |
Sadly this was done in a business context and I'm not permitted to share code. |
I see. Would you please give a more detailed hint to solve this problem? |
My code creates a "cloud" of random points around the instance. The cloud is created within an n-sphere (https://en.wikipedia.org/wiki/N-sphere) where "n" is the number of dimensions of your decision space. In a spherical coordinate, you need n-1 angles along with the distance from the origin in order to uniquely define the position of a given point. |
Hi,
with this code:
I would expect, that calling the explanation for the same datapoint several times would lead to the same result. Unfortunately, this is not the case, as I always get different values for Prediction local and the feature weights.
How would it be possible to get reproducable results here?
Thanks in advance!
The text was updated successfully, but these errors were encountered: