@a5c-ai/shap-explainer
ASHAP-based model explainability skill for feature attribution, summary plots, and interaction analysis.
Install
agr install @a5c-ai/shap-explainer --target claudeWrites 2 files into .claude/skills/, pinned to git-0606d280.
- .claude/skills/shap-explainer/README.md
- .claude/skills/shap-explainer/SKILL.md
Document
name: shap-explainer description: SHAP-based model explainability skill for feature attribution, summary plots, and interaction analysis. allowed-tools:
- Read
- Write
- Bash
- Glob
- Grep graph: domains: [domain:data-science] specializations: [specialization:data-science-ml] skillAreas: [skill-area:explainability-interpretation, skill-area:model-explainability-testing] roles: [role:data-scientist, role:ml-engineer] workflows: [workflow:ml-model-lifecycle]
shap-explainer
Overview
SHAP-based model explainability skill for feature attribution, summary plots, interaction analysis, and model interpretation.
Capabilities
- TreeExplainer for tree-based models (XGBoost, LightGBM, Random Forest)
- DeepExplainer for neural networks
- KernelExplainer for model-agnostic explanations
- Summary, dependence, and force plots
- Interaction value computation
- Cohort-based analysis
- Waterfall and bar plots
- Expected value analysis
Target Processes
- Model Interpretability and Explainability Analysis
- Model Evaluation and Validation Framework
- A/B Testing Framework for ML Models
Tools and Libraries
- SHAP
- matplotlib
- numpy
Input Schema
{
"type": "object",
"required": ["modelPath", "dataPath", "explainerType"],
"properties": {
"modelPath": {
"type": "string",
"description": "Path to the trained model"
},
"dataPath": {
"type": "string",
"description": "Path to data for explanation"
},
"explainerType": {
"type": "string",
"enum": ["tree", "deep", "kernel", "linear", "gradient"],
"description": "Type of SHAP explainer to use"
},
"analysisConfig": {
"type": "object",
"properties": {
"numSamples": { "type": "integer" },
"backgroundSamples": { "type": "integer" },
"featureNames": { "type": "array", "items": { "type": "string" } },
"outputIndex": { "type": "integer" }
}
},
"plotConfig": {
"type": "object",
"properties": {
"plotTypes": {
"type": "array",
"items": { "type": "string", "enum": ["summary", "bar", "waterfall", "force", "dependence", "interaction"] }
},
"maxFeatures": { "type": "integer" },
"outputDir": { "type": "string" }
}
}
}
}
Output Schema
{
"type": "object",
"required": ["status", "shapValues"],
"properties": {
"status": {
"type": "string",
"enum": ["success", "error"]
},
"shapValues": {
"type": "string",
"description": "Path to SHAP values file"
},
"expectedValue": {
"type": "number"
},
"featureImportance": {
"type": "array",
"items": {
"type": "object",
"properties": {
"feature": { "type": "string" },
"importance": { "type": "number" },
"rank": { "type": "integer" }
}
}
},
"plots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"path": { "type": "string" }
}
}
},
"interactions": {
"type": "object",
"description": "Top feature interactions"
}
}
}
Usage Example
{
kind: 'skill',
title: 'Generate SHAP explanations',
skill: {
name: 'shap-explainer',
context: {
modelPath: 'models/xgboost_model.pkl',
dataPath: 'data/test.csv',
explainerType: 'tree',
analysisConfig: {
numSamples: 1000,
backgroundSamples: 100
},
plotConfig: {
plotTypes: ['summary', 'bar', 'dependence'],
maxFeatures: 20,
outputDir: 'explanations/'
}
}
}
}
Trustgrade A
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- passLicense
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-0606d280ca3d2026-07-31