SHAP (SHapley Additive exPlanations) is a game theoretic approach to explain the output of any machine learning model. It connects optimal credit allocation with local explanations using the classic Shapley values from game theory and their related extensions. While SHAP can explain the output of any machine learning model, we have developed a high-speed exact algorithm for tree ensemble methods. Fast C++ implementations are supported for XGBoost, LightGBM, CatBoost, scikit-learn and pyspark tree models. To understand how a single feature effects the output of the model we can plot the SHAP value of that feature vs. the value of the feature for all the examples in a dataset. Since SHAP values represent a feature's responsibility for a change in the model output, the plot below represents the change in predicted house price as RM (the average number of rooms per house in an area) changes.

Features

  • SHAP can be installed from either PyPI or conda-forge
  • Take the mean absolute value of the SHAP values for each feature to get a standard bar plot
  • Natural language examples (transformers)
  • SHAP has specific support for natural language models
  • Deep learning examples with DeepExplainer
  • Deep SHAP is a high-speed approximation algorithm for SHAP values in deep learning models

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow SHAP

SHAP Web Site

Other Useful Business Software
Gemini 3 and 200+ AI Models on One Platform Icon
Gemini 3 and 200+ AI Models on One Platform

Access Google's best plus Claude, Llama, and Gemma. Fine-tune and deploy from one console.

Build generative AI apps with Vertex AI. Switch between models without switching platforms.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of SHAP!

Additional Project Details

Programming Language

Python

Related Categories

Python Machine Learning Software, Python Deep Learning Frameworks

Registered

2022-07-29