Examples¶
These examples are generated from jupyter notebooks, which are all available on Github
Kernel Explainer¶
Some examples using the shap.KernelExplainer
Tree Explainer¶
Some examples using the shap.TreeExplainer
- Basic SHAP Interaction Value Example in XGBoost
- Census income classification with LightGBM
- Census income classification with XGBoost
- Example of loading a custom tree model into SHAP
- Explaining a simple OR function
- Explaining the Loss of a Tree Model
- Fitting a Linear Simulation with XGBoost
- Force Plot Colors
- Front page example (XGBoost)
- League of Legends Win Prediction with XGBoost
- NHANES I Survival Model
- Speed comparison of gradient boosting libraries for shap values calculations
- parameters
- Python Version of Tree SHAP
- Scatter Density vs. Violin Plot
- Understanding Tree SHAP for Simple Models
- XGBoost Multi-class Example
Deep Explainer¶
Some examples using the shap.DeepExplainer
Gradient Explainer¶
Some examples using the shap.GradientExplainer
Linear Explainer¶
Some examples using the shap.LinearExplainer
Partition Explainer¶
Some examples using the shap.PartitionExplainer
Plots¶
Some examples using shap.plots
- Documentation by example for
shap.plots.bar
- Documentation by example for
shap.plots.beeswarm
- Documentation by example for
shap.plots.decision_plot
- Documentation by example for
shap.dependence_plot
- Documentation by example for
shap.plots.heatmap
- Documentation by example for
shap.plots.scatter
- Documentation by example for
shap.plots.text
- Documentation by example for
shap.plots.waterfall