Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

A Python library that explains individual predictions by estimating how much each input feature pushed the model’s output up or down, based on Shapley values from game theory.

Full nameSHapley Additive exPlanations
Websitehttps://shap.readthedocs.io
Source codehttps://github.com/shap/shap
Developed byScott Lundberg, SHAP open-source contributors (2017)
TypeSoftware library: Python package
Lifecycle phaseDevelopment, Evaluation
FUTURE-AIExplainability
ForAI developers, Researchers
FacilitationNo facilitator needed
Skills neededPython, basic machine learning
CostFree
LanguagesEnglish
MaturityEstablished
LicenceMIT

What it is

SHAP assigns every feature a contribution to a single prediction so that the contributions add up to the difference between that prediction and the average one. You can use fast exact explainers for tree ensembles, or slower model-agnostic and deep learning explainers for other models. The library also produces plots, such as waterfall, beeswarm and dependence plots, that show both single-case explanations and global patterns across a dataset. Keep in mind that SHAP explains the model’s behaviour, not the causal effect of a feature on the patient.

In healthcare

SHAP has a published clinical use by its own authors: Lundberg and colleagues (2018) used it to explain real-time predictions of hypoxaemia risk during surgery to anaesthesiologists. It works best for tabular data such as lab values and vital signs; for medical images, saliency methods are often easier for clinicians to read.

Where to use it in The ELSA Way

References

Also listed in: RAAIT toolbox.

References
  1. Lundberg, S. M., Nair, B., Vavilala, M. S., Horibe, M., Eisses, M. J., Adams, T., Liston, D. E., Low, D. K.-W., Newman, S.-F., Kim, J., & Lee, S.-I. (2018). Explainable machine-learning predictions for the prevention of hypoxaemia during surgery. Nature Biomedical Engineering, 2(10), 749–760. 10.1038/s41551-018-0304-0