talira

Explain any machine learning model's predictions with Shapley values

open sourceMITself-hostablefree

SHAP (SHapley Additive exPlanations) is a Python library that explains the output of any machine learning model using Shapley values from game theory: for each prediction, it says how much each feature pushed the result up or down. It has fast exact explainers for tree ensembles (XGBoost, LightGBM, CatBoost, scikit-learn trees), explainers for deep learning models, and model-agnostic ones for anything else, with plots for single predictions (waterfall, force) and whole datasets (beeswarm, summary, dependence). GPU-accelerated Tree SHAP comes in a separate shap-cuda package.

Problems it solves

  • explain why my machine learning model made a particular prediction
  • which features matter most to my XGBoost model
  • show stakeholders how each input affected a model's output
  • feature importance that's consistent across models

Features

  • Shapley value explanations for any model
  • fast exact Tree SHAP for tree ensembles
  • deep learning and model-agnostic explainers
  • waterfall, force, beeswarm and dependence plots
  • GPU Tree SHAP through shap-cuda