shap

Explain model predictions by attributing feature contributions with SHAP values.

18|1|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/LogauaEngstrom/claude-scientific-skills --skill shap-logauaengstrom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shap
Source: https://github.com/LogauaEngstrom/claude-scientific-skills/tree/main/scientific-skills/shap
Command: npx skills add https://github.com/LogauaEngstrom/claude-scientific-skills --skill shap-logauaengstrom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SHAP values provide a principled way to decompose model predictions into contributions from individual features, enabling transparent and actionable explanations.

Core Features & Use Cases

  • Comprehensive guidance to compute SHAP values for any model, generate global and local explanations, visualize results, and assess fairness and bias.
  • Supports TreeExplainer, DeepExplainer, KernelExplainer, LinearExplainer, GradientExplainer, and PermutationExplainer across tree-based, deep learning, and linear models.
  • Use cases include debugging, model comparison, feature engineering, and production deployment of explainable AI.

Quick Start

Explain a trained model's predictions by computing SHAP values with TreeExplainer and visualize the results.

Frequently Asked Questions about shap

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

FAQPage Schema
How do I explain machine learning model predictions using SHAP values?

You can explain machine learning model predictions by computing SHAP values to decompose predictions into individual feature contributions. This skill guides you through selecting an appropriate explainer, providing background data for baselines, computing the values, and visualizing the results.

What is the difference between global and local explanations for model predictions?

Global explanations show overall feature importance across a dataset, while local explanations detail feature contributions for a specific prediction. SHAP values provide a principled way to generate both, enabling transparent debugging and actionable fairness analysis.

Can I use SHAP to explain predictions for deep neural networks and tree-based models?

Yes, you can explain predictions for deep neural networks and tree-based models. This skill supports multiple explainers including TreeExplainer, DeepExplainer, KernelExplainer, LinearExplainer, GradientExplainer, and PermutationExplainer across different model architectures.

How do I compute SHAP values for a trained model?

To compute SHAP values for a trained model, you must select the appropriate explainer for your model type and provide background data for baselines. The skill guides you through applying the explainer to generate and visualize the feature attributions.

Why do I need to provide background data when calculating SHAP values?

You need to provide background data when calculating SHAP values to establish a baseline for feature attribution. This baseline allows the explainer to accurately measure how individual features contribute to the difference between the current prediction and the average prediction.

When should I use TreeExplainer versus KernelExplainer for model explanation?

Use TreeExplainer for tree-based models to get exact SHAP values efficiently, whereas KernelExplainer applies to any differentiable model using approximations. Selecting the appropriate explainer ensures accurate feature attribution across debugging, feature engineering, and fairness analysis.