AI GLOSSARY · AI CONCEPTS

SHAP values

Markdown version

Definition

SHAP values give each input feature a score for how much it contributed to one model prediction. The method is based on Shapley values from game theory and is used to explain machine learning model output.

Also called: SHAP, SHapley Additive exPlanations, Shapley values machine learning, SHAP explainability, SHAP explanation.

In plain language

A model can give a loan decision or a price estimate without saying why. SHAP is a way to split the credit. Picture a team that wins a prize, and you want to share it fairly by asking how much each member added across many possible line-ups. SHAP does the same with the facts the model was given, such as age or income, and reports how each pushed one prediction up or down. It helps a person inspect a model. The limits: it can be slow, it describes the model and not the real world, and an explanation can be misread or be misleading, so it is not proof that a model is fair.

Technical definition

Lundberg and Lee's paper introduces SHAP (SHapley Additive exPlanations), which assigns each feature an importance value for a particular prediction. They show that a single solution in a class of additive feature importance measures has a set of desirable properties, and argue the class includes six existing explanation methods. The SHAP documentation describes it as a game theoretic approach that connects optimal credit allocation with local explanations using Shapley values. Molnar's Interpretable Machine Learning book describes averaging each feature's marginal contribution across coalitions of features and notes that KernelSHAP is slow, that TreeSHAP works for tree-based models, and that explanations can be misread.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    data-analysis-eda 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    The skill is a fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.
    Why it exercises the concept
    A contrast case. Profiling the data before modelling shows which columns exist and how they behave, which gives context for reading feature scores. It does not compute SHAP values. The catalogue has no model-explanation skill; illustrative, not executed.
  2. Skill by Skill Almanac · Illustrative, not executed

    split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    The skill checks train, validation and test files for duplicates, shared groups, time and label leakage and prints JSON.
    Why it exercises the concept
    A feature that leaks the answer can receive a large score in any explanation, which then looks like insight. Checking for leakage first is a sensible companion step. This skill does not compute SHAP. Illustrative, not executed.
  3. Skill by Hugging Face · Illustrative, not executed

    huggingface-datasets 25/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    The skill reads Hugging Face datasets through the Dataset Viewer API: metadata, rows, search and filters.
    Why it exercises the concept
    Explaining a model needs the rows it was run on. This skill reads dataset rows and metadata, which is adjacent to the input side of SHAP and does not compute attributions. Illustrative, not executed.

How it shows up when you use agents

SHAP shows up when you ask Claude Code, Codex or Cursor to build a model on tabular data and explain it. A typical script imports the shap Python package, builds an explainer for the trained model and draws a plot of feature contributions. The documentation lists examples for tabular, text and image models.

What breaks when it is misunderstood: the plot gets treated as a cause. SHAP allocates attribution for a prediction relative to the explainer's chosen value function, background data and reference output; it does not establish real-world causes or prove direct model use of each credited feature. Molnar's book notes that explanations can be misread and can even be deliberately misleading. Correlated features are another weak point: it describes how some estimation methods can place weight on unlikely data points.

A practical next step: ask the agent which explainer it used, which model it explained, which rows it ran on and whether a leakage check came first. Then compare the story the plot tells with what the data says. The wider topics are explainable AI and interpretability. The catalogue has no skill that computes SHAP values, so the examples are contrast cases.

Common confusions

  • SHAP versus Shapley values. Shapley values are the game-theory idea. SHAP is a method, introduced by Lundberg and Lee, for estimating and using them to explain predictions.
  • Local versus global. A SHAP value explains one prediction. Molnar notes the idea extends to global explanations by combining values across many instances.
  • Explanation versus causation. A large attribution is relative to the chosen explanation setup, not proof of direct model use or a real-world intervention effect. Molnar notes that conditional or path-dependent TreeSHAP can credit an unused feature correlated with one that affects the prediction.
  • Myth: an explanation proves fairness. Molnar warns that explanations can hide bias, so an explanation is a prompt for review, not a verdict.

More in AI concepts

Next steps

  1. data-analysis-eda A skill that exercises it.
  2. Interpretability Related term.
  3. Explainable AI (XAI) Related term.
  4. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.

Review record

Last verified

Drafted by Claude (original draft); OpenAI Codex (bounded factual repairs); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .

Change log (5)
  • : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
  • : First version.
  • : Verifier pass: applied verifier corrections to unsupported or overstated claims.
  • : Bounded source repairs: Scoped SHAP attribution to explainer value function/background and preserved conditional-feature and real-world causation limits. Pending independent re-review.
  • : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.