Last active
April 11, 2023 19:46
-
-
Save joshreini1/cd70b5203206e8b7a2f526dacab4454e 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
# import trushap, and optionally alias as shap to preserve your SHAP code. | |
from truera.client.experimental.trushap import trushap as shap | |
# Initialize the explainer. | |
# Include TruEra authentication (optional) to add the model to your TruEra deployment. | |
explainer = shap.Explainer(model, connection_string = CONNECTION_STRING, token = TOKEN) | |
# Calculate shapley values AND add data split to your TruEra deployment. | |
shap_values = explainer(X, id_col_name = "id") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment