Created
May 30, 2022 14:50
-
-
Save rkdgusrn1212/0678f0e93216bd538809c28fef787a7c to your computer and use it in GitHub Desktop.
SHAP in python
This file contains hidden or 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
import shap | |
#Tree, Deep or kernel | |
explainer = shap.TreeExplainer(my_model) | |
shap_values = explainer.shap_values(single_record) | |
shap.initjs() | |
shap.force_plot(explainer.expected_value[0], shap_values[0], single_record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment