Skip to content

Instantly share code, notes, and snippets.

@zronaghi
Created March 8, 2021 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zronaghi/209a059a224c0364fea1fb6098de165d to your computer and use it in GitHub Desktop.
Save zronaghi/209a059a224c0364fea1fb6098de165d to your computer and use it in GitHub Desktop.
bst.set_param({"predictor": "gpu_predictor"})
shap_array = np.abs(bst.predict(X,pred_contribs=True))
shap_values = pd.DataFrame(data=shap_array[:,:-1],columns=list(bst.feature_names))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment