Skip to content
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

Important features list is randomly changing #77

Closed
GichanLee opened this issue Dec 9, 2021 · 1 comment
Closed

Important features list is randomly changing #77

GichanLee opened this issue Dec 9, 2021 · 1 comment

Comments

@GichanLee
Copy link

GichanLee commented Dec 9, 2021

Hello, @marcotcr. I'm so glad to use your anchor. it is a really great work.
but I wanna ask something is not clear to me.
If I repetitively execute AnchorTabularExplainer like below codes, I get different important features list randomly.

rf_explainer_anchor = anchor_tabular.AnchorTabularExplainer(
    ['True', 'False'],
    list(X_train.columns),
    X_train.values, 
    {})
np.random.seed(1)
for i in range(0, 10):
    rf_anchor_importance = list()
    rf_exp_anchor = rf_explainer_anchor.explain_instance(X_test.values[0],
                                                    rf_clf.predict,
                                                    threshold=0.95)
    rf_anchor_importance.append(rf_exp_anchor.exp_map['feature'])
    print(rf_anchor_importance)
[[4, 18, 17]]
[[1, 18, 17]]
[[5, 18, 17]]
[[0, 18, 17]]
[[11, 18, 17]]
[[0, 18, 17]]
[[6, 18, 17]]
[[3, 10, 0]]
[[0, 18, 17]]
[[0, 18, 17]]

(I figured out that 'rf_clf' is fixed and np.random.seed(1) is working)
Did I use it wrongly? or is it working as intended?
If I was using it wrongly, how can I get fixed anchor?
I wanna get most important features ranked by the probabilities.

@GichanLee
Copy link
Author

marcotcr/lime#67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant