Explain
Explain model predictions with SHAP, LIME, integrated gradients, and permutation importance. Generates summary plots, waterfall charts, and force plots. Use when debugging predictions, auditing for bias, or communicating model behavior to stakeholders.From its SKILL.md
npx -y skills add damionrashford/mlx --skill explainAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.0 KB, as published. Nobody here has run it
Explain Skill
Generate model explanations with SHAP, LIME, integrated gradients, and permutation importance.
Quick start
# Auto-detect model type and run SHAP
uv run ${CLAUDE_SKILL_DIR}/scripts/shap_explain.py model.joblib data/test.csv
# Output: explanations/shap_summary.png
Methods by model type
| Model type | Recommended explainer |
|---|---|
| sklearn tree (RF, XGBoost) | SHAP TreeExplainer |
| sklearn linear | SHAP LinearExplainer |
| PyTorch/TF | SHAP DeepExplainer or captum |
| Any black-box | SHAP KernelExplainer (slow) or LIME |
Plots
shap.summary_plot()— global feature importance (beeswarm)shap.waterfall_plot()— single prediction breakdownshap.force_plot()— interactive prediction visualizationshap.dependence_plot()— feature interaction effectsPartialDependenceDisplay— marginal effect of one feature
When to use each
- SHAP: most accurate, works for any model, gold standard
- LIME: fast approximation, good for text and images
- Integrated gradients: neural nets only, attribution to input features
- Permutation importance: model-agnostic, measures drop in metric when feature shuffled
See references/explainability-guide.md for complete documentation and code examples.