Created
February 21, 2021 11:32
-
-
Save Lakshmi-1212/b940f2022751744319818d28a033992a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Explanation from LIME model for observation 1 | |
observation = 1 | |
# Set the predict function for the model | |
predict_fn = lambda x: rfmodel.predict_proba(x).astype(float) | |
# Explain the prediction | |
lime_explanation = rfexplainer.explain_instance(X_test.values[observation], rfpredict_fn, num_features=10) | |
# Show the explanation in the notebook | |
lime_explanation.show_in_notebook(show_table=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment