shap

Compute SHAP values and generate global and local explanation plots.

46|4|Updated Apr 8, 2023
One-click install
npx skills add https://github.com/CRAG666/dotfiles --skill shap-crag666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shap
Source: https://github.com/CRAG666/dotfiles/tree/main/skills/shap
Command: npx skills add https://github.com/CRAG666/dotfiles --skill shap-crag666

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you understand and communicate why a machine learning model produced a specific prediction or an overall feature ranking.

Core Features & Use Cases

  • Compute SHAP values for any model type: Choose the right explainer for tree-based models, deep learning, linear models, or black-box models.
  • Generate interpretability visualizations: Create global and local plots such as beeswarm, bar, waterfall, force, scatter, and heatmap.
  • Debug and validate model behavior: Inspect unexpected feature importance, analyze bias/fairness by cohort, and compare models using consistent attributions.
  • Integrate explanations into workflows: From experimentation and reporting to production deployment and monitoring.

Quick Start

Ask to explain “which features drive my model’s prediction” and the Skill will guide you to select an explainer, compute SHAP values, and generate the right plot(s).

Frequently Asked Questions about shap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I explain which features drive my machine learning model's predictions?

To explain model predictions, you compute SHAP values to attribute output changes to specific input features. This process requires selecting an appropriate explainer for your model type and generating visualizations like beeswarm or waterfall plots to show feature importance.

Can I use SHAP to perform fairness and bias checks across different cohorts?

Yes, SHAP supports fairness analysis by decomposing model predictions into feature contributions. You can group SHAP values by cohort to inspect for bias, validate model behavior across demographics, and compare attributions to ensure equitable outcomes.

How do I generate interpretability visualizations for global and local model explanations?

You generate interpretability visualizations by computing SHAP values and mapping them to plots like beeswarm, bar, waterfall, force, scatter, or heatmaps. Local plots explain individual predictions while global plots summarize overall feature importance across the dataset.

Does this approach work for explaining both tree-based models and deep learning?

Yes, model interpretability via SHAP applies to tree-based models, deep learning, linear models, and black-box models. You must select the corresponding SHAP explainer algorithm designed for your specific model architecture to compute accurate attribution values.

What is the best way to debug unexpected feature importance in a machine learning model?

The best way to debug unexpected feature importance is to compute SHAP values to inspect how individual features influence specific predictions. Generating local and global explanation plots helps validate model behavior and identify anomalies in feature attributions.