Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import shap
- #initialize js methods for visualization
- shap.initjs()
- # create an instance of the DeepSHAP which is called DeepExplainer
- explainer_shap = shap.DeepExplainer(model=model,
- data=X_train)
- # Fit the explainer on a subset of the data (you can try all but then gets slower)
- shap_values = explainer_shap.shap_values(X=X_train.values[:500],
- ranked_outputs=True)
Add Comment
Please, Sign In to add comment