Created
May 30, 2022 18:02
-
-
Save rkdgusrn1212/61fccfec23d940fff2bae32eb9d35037 to your computer and use it in GitHub Desktop.
SHAP Summary Plot
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 # package used to calculate Shap values | |
#tree or deep or kernel | |
explainer = shap.TreeExplainer(my_model) | |
shap_values = explainer.shap_values(val_X)#전체 record에 대한 shap 값들이 필요하다. | |
shap.summary_plot(shap_values[1], val_X)#shap_values[1]는 regression에서 possitive. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment