shap

shap is a skill for Claude Code from Lzy599775/agent-auto-sci-skills. It costs 46 tokens per session (3,108 once invoked), scanned A, original, MIT.

A guide to SHAP, a method for describing how individual input features influence a machine-learning model’s predictions.

In plain words
What is it for?
Use it for feature-attribution calculations, local or overall model explanations, multi-output predictions, and SHAP visualisations.
Why use it?
It helps produce and validate explanations for a fixed model while making clear which output and reference data the explanation uses. It does not replace model evaluation or prove cause and effect.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it for feature-attribution calculations, local or overall model explanations, multi-output predictions, and SHAP visualisations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lzy599775/agent-auto-sci-skills/shap
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Lzy599775/agent-auto-sci-skills --skill shap
Clone the repo
git clone --depth 1 https://github.com/Lzy599775/agent-auto-sci-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shap

README.md
[![agentmods](https://agentmods.dev/badge/skills/lzy599775/agent-auto-sci-skills/shap/github.svg)](https://agentmods.dev/skills/lzy599775/agent-auto-sci-skills/shap)
Your own site
<a href="https://agentmods.dev/skills/lzy599775/agent-auto-sci-skills/shap"><img src="https://agentmods.dev/badge/skills/lzy599775/agent-auto-sci-skills/shap/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for shap

Your own site · 80×15
<a href="https://agentmods.dev/skills/lzy599775/agent-auto-sci-skills/shap"><img src="https://agentmods.dev/badge/skills/lzy599775/agent-auto-sci-skills/shap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.03108
Opus 5 $0.00023 $0.01554
Sonnet 5 $0.00009 $0.00622
Haiku 4.5 $0.00005 $0.00311

Measured 3d ago against content hash 6e1e3a128848, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

shap scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/tabular_report.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/kdense-ml-ai-selected/subskills/k-dense/shap/SKILL.md · 300 lines

How it starts

The opening of the file, as written. The whole thing — 300 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SHAP

Use SHAP to describe how a fitted predictive model maps inputs to outputs. Work from the modern shap.Explanation API, make the explained output and background distribution explicit, and validate every explanation before interpreting it.

This skill is aligned with SHAP 0.52.0 (released 2026-05-28). That release requires Python 3.12 or newer.

Operating Rules

  1. Explain a fixed, evaluated model; do not use SHAP as a substitute for predictive validation.
  2. Use held-out or clearly labeled analysis rows for explanations. Choose background rows only from an appropriate training or reference population.
  3. State the explained output: regression value, raw margin, probability, log loss, logit, or another model method.
  4. Keep explanations as shap.Explanation objects. Call explainer(X); use .shap_values(X) only when maintaining legacy code.
  5. For multi-output models, select one output before using tabular plots: explanation[..., output_index].
  6. Check base_values + values.sum(...) against the exact model output being explained.
  7. Treat SHAP as a description of model behavior under a masking/background choice. It does not establish causality, fairness, recourse, or scientific mechanism.
  8. Never silence an additivity failure until input shape, preprocessing, model version, output space, and row ordering have been checked.
  9. Do not load untrusted pickle, joblib, model, or explainer artifacts; those formats can execute code during deserialization.

Install

Create an isolated environment and pin the documented release:

uv venv --python 3.12
source .venv/bin/activate
uv pip install "shap[plots]==0.52.0"

shap[plots] installs the plotting dependencies. Add the fitted model's package at a version compatible with the project. For older Python compatibility, read references/migration.md instead of silently installing a different SHAP release.

Confirm the environment before debugging an API mismatch:

import platform
import shap

print("Python:", platform.python_version())
print("SHAP:", shap.__version__)

Read the full file on GitHub · 300 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +17 lines 6e1e3a128848
  2. 9d ago First seen · 283 lines · 46 tokens per session scan A 3399fa65f163

Subscribe to this mod's changes

shap is a skill published in the GitHub repository Lzy599775/agent-auto-sci-skills (2 stars, last pushed 3d ago), licensed MIT. It adds 46 tokens to every session and 3,108 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

baoyu-danger-gemini-web

Generates images and text via reverse-engineered Gemini Web API. Supports text generation, image generation from prompts, reference images for vision input, and multi-turn conversations. Use when other skills need image generation backend, or when user requests "generate image with Gemini", "Gemini text generation"…

JimLiu/baoyu-skills · 74 tokens

understand-knowledge

Analyze a Karpathy-pattern LLM wiki knowledge base and generate an interactive knowledge graph with entity extraction, implicit relationships, and topic clustering.

Egonex-AI/Understand-Anything · 32 tokens

compute-normalization

Normalize results by compute budget (Pareto analysis).

yogsoth-ai/de-anthropocentric-research-engine · 14 tokens

clean-data

Interactive data profiling and cleaning assistant for medical research. Three-stage workflow (profile, flag, code-generate) with user approval gates at each step. Handles missing values, outliers, duplicates, and type mismatches in CSV/Excel clinical data. Does NOT auto-clean — all decisions require researcher…

Aperivue/medsci-skills · 64 tokens

model-scaffold

Generate a reproducible, runnable PyTorch training repo for a medical-imaging task — segmentation, classification, detection, image-to-image synthesis, self-supervised pretraining, or fine-tuning a pretrained backbone (transfer learning) — the missing middle link between choosing an architecture and validating a…

Aperivue/medsci-skills · 191 tokens

generate-codebook

Generate a citable data dictionary / codebook from a tabular dataset (CSV/TSV/Excel/Parquet/Stata/SAS). Profiles every variable — role, type, units placeholder, level frequencies, range/quantiles, missingness — and emits codebook.md + codebook.json. Flags coded variables whose level meanings are unknown as [NEEDS…

Aperivue/medsci-skills · 97 tokens