Guest User

Untitled

a guest
Nov 17th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import shap
  2.  
  3. #initialize js methods for visualization
  4. shap.initjs()
  5.  
  6. # create an instance of the DeepSHAP which is called DeepExplainer
  7. explainer_shap = shap.DeepExplainer(model=model,
  8. data=X_train)
  9.  
  10. # Fit the explainer on a subset of the data (you can try all but then gets slower)
  11. shap_values = explainer_shap.shap_values(X=X_train.values[:500],
  12. ranked_outputs=True)
Add Comment
Please, Sign In to add comment