Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

SHAP Model Explanation Skill

Guides Claude through choosing SHAP explainers, computing and validating attributions, and plotting them correctly.

Data & AnalyticsAdvanced33,0303,248AI score 9/10Last updated: Aug 9, 2026

What it does

A disciplined playbook for explaining and auditing machine-learning predictions with SHAP, built to prevent the most common misuses.

  • Decision table for explainer and masker selection (tree, linear, exact, permutation, partition, deep, kernel)
  • Modern shap.Explanation API patterns, including correct multi-output slicing (exp[..., 1] instead of legacy values[class_index])
  • An additivity check: verify base_values + values.sum(axis=1) against the exact model output
  • Forces you to state the explained output space — probability, raw margin, log-loss, logit
  • Question-to-plot mapping: bar, beeswarm, waterfall, scatter, heatmap, cohorts, text/image
  • Fixed troubleshooting order plus a mandatory limitations checklist (explicit non-causal statement)
  • Safety rules: never deserialize untrusted pickle/joblib model artifacts

Who it's for

  • Data scientists whose explanations end up in reports, model risk reviews, or regulatory filings
  • Anyone repeatedly tripped up by SHAP array shapes in multiclass problems
  • Practitioners needing probability-space tree explanations and interventional vs tree-path-dependent semantics
  • NLP/vision engineers applying SHAP with text and image maskers

Examples

  1. "Compute SHAP values for my RandomForest binary classifier on the test set, select the positive class, run the additivity assertion, then plot beeswarm and a waterfall for row 0."
  2. "I need probability-space explanations for an XGBoost model — how should I set background data and feature_perturbation?"
  3. "Compare SHAP attributions across cohorts for a multiclass model and draft the limitations paragraph so it isn't read as a fairness test."

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/shap folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/shap/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/shap ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal.
  2. Create the skills directory if needed: mkdir -p ~/.claude/skills
  3. Clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills
  4. Copy just this skill: cp -r /tmp/scientific-agent-skills/skills/shap ~/.claude/skills/
  5. Verify with ls ~/.claude/skills/shap — you should see SKILL.md and a references folder.
  6. Set up Python: uv venv --python 3.12 && source .venv/bin/activate && uv pip install "shap[plots]". If the documented 0.52.0 pin does not resolve, run pip index versions shap and install the latest real release.
  7. Restart Claude Code and ask something like "Use SHAP to explain this model's predictions" to trigger the skill.