#2323rd of 26 in ML frameworks and libraries

shap

Python library that explains ML model predictions with Shapley values

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
Also in ML frameworks and libraries
RankProjectScore
1transformersPython library defining open models for text, vision, audio and multimodal tasks167.7k starsApache-2.094 out of 100
2pytorchPython tensor library with GPU support and tape-based autograd for deep learning104.7k starscustom license93 out of 100
3ultralyticsPython library and CLI for training and running YOLO vision models62.5k starsAGPL-3.089 out of 100
#4supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.2k starsMIT85 out of 100
#5pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts37.2k starsApache-2.083 out of 100