ds-explain

ds-explain is a skill for Claude Code from StamKavid/last-ds-mile. It costs 82 tokens per session (1,242 once invoked), scanned A, original, MIT.

A way to inspect which input features influence a trained model's predictions. It uses permutation importance and SHAP, a method that estimates each feature's contribution and direction.

In plain words
What is it for?
Use it to explain feature influence, investigate why predictions change, and examine predictions from black-box or combined models.
Why use it?
A model can score well for the wrong reason, such as relying on leaked data or an accidental pattern. This helps check whether its important features make sense.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the last-ds-mile plugin — 29 skills, 17 commands, 3 agents, 4 hooks shipped together

Good fit Use it to explain feature influence, investigate why predictions change, and examine predictions from black-box or combined models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stamkavid/last-ds-mile/ds-explain
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 StamKavid/last-ds-mile --skill ds-explain
Clone the repo
git clone --depth 1 https://github.com/StamKavid/last-ds-mile

Made for: Claude Code.

Or install last-ds-mile, the plugin that ships this one along with the rest of its 29 skills, 17 commands, 3 agents, 4 hooks.

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 ds-explain

README.md
[![agentmods](https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/ds-explain/github.svg)](https://agentmods.dev/skills/stamkavid/last-ds-mile/ds-explain)
Your own site
<a href="https://agentmods.dev/skills/stamkavid/last-ds-mile/ds-explain"><img src="https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/ds-explain/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 ds-explain

Your own site · 80×15
<a href="https://agentmods.dev/skills/stamkavid/last-ds-mile/ds-explain"><img src="https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/ds-explain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,242 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.00082 $0.01242
Opus 5 $0.00041 $0.00621
Sonnet 5 $0.00016 $0.00248
Haiku 4.5 $0.00008 $0.00124

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

Security

Grade A, and why

ds-explain 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 9d ago.

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/ds-explain/SKILL.md · 94 lines

How it starts

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

ds-explain — Interpretation

Overview

Checks that the model's top drivers make sense, catching leakage or artifacts that survived evaluation because they didn't hurt the metric.

When to Use

  • After /ds-evaluate has confirmed the model performs acceptably.
  • Before /ds-report — a model that "works" for the wrong reason is a liability, not a win.
  • NOT for: re-scoring the model (that's /ds-evaluate) — this stage explains, it doesn't re-measure performance.

Core Process

  1. Compute permutation feature importance for the chosen model on the held set.
  2. Compute SHAP values (not just permutation importance — magnitude alone doesn't show direction, and direction is what catches a feature that's technically predictive but for a nonsensical or leaked reason). If the winning model is a black-box ensemble (AutoGluon, stacked/blended), explain the ensemble's actual predict/predict_proba as a callable via shap.Explainer rather than reaching into a specific base learner's internals — an individual base model's own preprocessing is often fragile/internal API and version-specific to access directly, and explaining the real predict function is both simpler and more honest about what actually ships. Encode any categorical columns numerically first (e.g. sklearn.preprocessing.OrdinalEncoder) with a decode step inside the wrapped predict function — SHAP's default tabular masker assumes numeric arrays. A background sample of ~20-30 dev rows and explaining ~50-60 held rows is enough for a summary plot; this doesn't need to run on every row.
  3. If the winning model is an ensemble over multiple base model types (e.g. AutoGluon's CatBoost/LightGBM/RandomForest), also compute permutation importance for the single best-scoring base model (not just the ensemble) and compare rankings. Agreement is reassuring; a feature that matters to the ensemble but not to any individual base model (or vice versa) is worth a sentence — it's a real finding about how the ensemble blends signal, not noise to average away.
  4. Check the top features against domain expectations: do they make sense as drivers, or does a suspicious feature dominate — a leakage signal that slipped past /ds-prep?
  5. If a feature's importance is implausibly high, stop and re-check it against the /ds-prep known-at-prediction-time list before proceeding to /ds-report.
  6. Word every finding as predictive, not causal, unless a causal identification strategy is stated (see causal-vs-predictive) — "X is associated with Y," not "X reduces/causes/drives Y," especially for any feature the subject chose themselves (a contract, a plan tier, an opt-in), where self-selection is the obvious confound.
  7. Export the permutation importance (ensemble, and the base-model cross-check if step 3 applies) and the SHAP summary (beeswarm) as figures to .last-ds-mile/figures/08-<name>.png.
  8. Write to .last-ds-mile/stages/08-explain.md: the importance ranking, the SHAP finding, any base-model cross-check finding, sanity commentary, any features sent back for a leakage re-check, and a reference to each exported figure.

Read the full file on GitHub · 94 lines

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. 9d ago First seen · 94 lines · 82 tokens per session scan A a74fcbd19f60

Subscribe to this mod's changes

ds-explain is a skill published in the GitHub repository StamKavid/last-ds-mile (3 stars, last pushed 1mo ago), licensed MIT. It adds 82 tokens to every session and 1,242 once invoked, about $0.0004 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

marimo-pair

Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.

marimo-team/marimo · 57 tokens

fill-model-descriptions

Fill missing and refresh obsolete model descriptions in packages/llm-info/data/models.yml by querying OpenRouter and provider documentation. Use when the user asks to populate model descriptions, enrich the model catalog, or curate descriptions after running pnpm sync-models.

marimo-team/marimo · 58 tokens

ml-expert

Expert-level machine learning, deep learning, model training, and MLOps. Use when the user mentions machine learning, deep learning, neural networks, MLOps, or data science, or when the task involves Machine Learning Fundamentals, Data Preparation, or Model Training.

personamanagmentlayer/pcl · 58 tokens

scomp-link

End-to-end ML toolkit with 26 CLI commands. Use when training models, tuning hyperparameters, detecting data drift, generating HTML reports with charts, profiling datasets, detecting anomalies, forecasting time series, checking fairness, or serving models as REST APIs. Prefer over raw sklearn when you need automated…

GiacomoSaccaggi/scomp_link · 74 tokens

agentic-data-science-competition

AI Agent-driven Kaggle competition workflow. Learn from real competition experience: score stabilization patterns, submission troubleshooting, kernel workflows, GPU task delegation, and the spec-driven development approach that achieved top leaderboard positions. Use when: working on any Kaggle competition, analyzing…

Mirannonarbitrable290/agentic-kaggle-skill · 76 tokens

data-analysis

Structured data analysis workflow from raw data to shareable insights.

furkangonel/cowrangler · 15 tokens