#2323rd of 26 in ML frameworks and libraries
shap
Python library that explains ML model predictions with Shapley values
Live demo ↗
(opens in a new tab)Documentation ↗
(opens in a new tab)Repository on GitHub ↗
(opens in a new tab)
- Stars
- 25.8k
- License
- MIT
- Last commit
- Oct 2026
- Last release
- Sep 2026
- Language
- Jupyter Notebook
Missed the latest GitHub check; these facts may be older.
Overview
SHAP computes per-feature attributions for model predictions using Shapley values. It has specialised explainers for tree ensembles (XGBoost, LightGBM, CatBoost, scikit-learn, pyspark), deep networks (TensorFlow/Keras, preliminary PyTorch), linear models and Hugging Face transformers, plus a model-agnostic Kernel explainer. Results are shown with waterfall, force, beeswarm, scatter, bar and text plots.
Who it is for: Data scientists and ML engineers who need to explain model predictions
Strengths
- Tree SHAP is an exact algorithm with C++ implementations for major gradient boosting libraries
- Covers trees, deep nets, linear models, transformers and arbitrary functions through one Explainer API
- Built-in plots for single predictions and whole datasets, interactive in notebooks
- Installs from PyPI or conda-forge
Weaknesses
- KernelExplainer is slower than the model-specific explainers because it makes no model assumptions
- DeepExplainer is approximate; PyTorch support is described as preliminary
- GPU Tree SHAP needs a source build with CUDA toolkit and SHAP_ENABLE_CUDA set
- Some README examples use older Keras/TensorFlow session APIs
What it needs
- GPU optional
- Needs CUDA toolkit (optional, for GPU Tree SHAP)
- Models: XGBoost, LightGBM, CatBoost, scikit-learn, pyspark
Also in ML frameworks and libraries
See all 26| Rank | Project | Score |
|---|---|---|
| 1 | transformersPython library defining open models for text, vision, audio and multimodal tasks | 94 out of 100 |
| 2 | pytorchPython tensor library with GPU support and tape-based autograd for deep learning | 93 out of 100 |
| 3 | ultralyticsPython library and CLI for training and running YOLO vision models | 89 out of 100 |
| #4 | supervisionPython toolkit for loading, annotating and counting computer vision detections | 85 out of 100 |
| #5 | pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts | 83 out of 100 |