Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计未展示

model-explainer模型解释器

Agent Skill

model-explainer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

449

周安装

18

GitHub Stars

127

下载量

145
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:model-explainer(模型解释器)
来源仓库:https://github.com/anton-abyzov/specweave
仓库路径:skills/model-explainer
安装命令:
npx skills add https://github.com/anton-abyzov/specweave --skill model-explainer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/anton-abyzov/specweave --skill model-explainer

简介

用于查找、检索和筛选相关信息,支持模型解释任务。

  • 适合根据关键词或任务场景快速定位候选结果。
  • 可结合来源仓库和原始 README 继续核验用法。
  • 安装前建议确认权限范围和维护状态。model-explainer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 支持 Codex、Claude、Cursor、Gemini CLI;通过 github 安装。

SKILL.md

Model Explainer

Overview

Makes black-box models interpretable. Explains why models make specific predictions, which features matter most, and how features interact. Critical for trust, debugging, and regulatory compliance.

Why Explainability Matters

  • Trust: Stakeholders trust models they understand
  • Debugging: Find model weaknesses and biases
  • Compliance: GDPR, fair lending laws require explanations
  • Improvement: Understand what to improve
  • Safety: Detect when model might fail

Explanation Types

1. Global Explanations (Model-Level)

Feature Importance:

from specweave import explain_model

explainer = explain_model(
    model=trained_model,
    X_train=X_train,
    increment="0042"
)

# Global feature importance
importance = explainer.feature_importance()

Output:

Top Features (Global):
1. transaction_amount (importance: 0.35)
2. user_history_days (importance: 0.22)
3. merchant_reputation (importance: 0.18)
4. time_since_last_transaction (importance: 0.15)
5. device_type (importance: 0.10)

Partial Dependence Plots:

# How does feature affect prediction?
explainer.partial_dependence(feature="transaction_amount")

2. Local Explanations (Prediction-Level)

SHAP Values:

# Explain single prediction
explanation = explainer.explain_prediction(X_sample)

Output:

Prediction: FRAUD (probability: 0.92)

Why?
+ transaction_amount=5000 → +0.45 (high amount increases fraud risk)
+ user_history_days=2 → +0.30 (new user increases risk)
+ merchant_reputation=low → +0.25 (suspicious merchant)
- time_since_last_transaction=1hr → -0.08 (recent activity normal)

Base prediction: 0.10
Final prediction: 0.92

LIME Explanations:

# Local interpretable model
lime_exp = explainer.lime_explanation(X_sample)

Usage in SpecWeave

from specweave import ModelExplainer

# Create explainer
explainer = ModelExplainer(
    model=model,
    X_train=X_train,
    feature_names=feature_names,
    increment="0042"
)

# Generate all explanations
explainer.generate_all_reports()

# Creates:
# - feature-importance.png
# - shap-summary.png
# - pdp-plots/
# - local-explanations/
# - explainability-report.md

Real-World Examples

Example 1: Fraud Detection

# Explain why transaction flagged as fraud
transaction = {
    "amount": 5000,
    "user_age_days": 2,
    "merchant": "new_merchant_xyz"
}

explanation = explainer.explain(transaction)
print(explanation.to_text())

Output:

FRAUD ALERT (92% confidence)

Main factors:
1. Large transaction amount ($5000) - Very unusual for new users
2. Account only 2 days old - Fraud pattern
3. Merchant has low reputation score - Red flag

If this is legitimate:
- User should verify identity
- Merchant should be manually reviewed

Example 2: Loan Approval

# Explain loan rejection
applicant = {
    "income": 45000,
    "credit_score": 620,
    "debt_ratio": 0.45
}

explanation = explainer.explain(applicant)
print(explanation.to_text())

Output:

LOAN DENIED

Main reasons:
1. Credit score (620) below threshold (650) - Primary factor
2. High debt-to-income ratio (45%) - Risk indicator
3. Income ($45k) adequate but not strong

To improve approval chances:
- Increase credit score by 30+ points
- Reduce debt-to-income ratio below 40%

Regulatory Compliance

GDPR "Right to Explanation"

# Generate GDPR-compliant explanation
gdpr_explanation = explainer.gdpr_explanation(prediction)

# Includes:
# - Decision rationale
# - Data used
# - How to contest decision
# - Impact of features

Fair Lending Act

# Check for bias in protected attributes
bias_report = explainer.fairness_report(
    sensitive_features=["gender", "race", "age"]
)

# Detects:
# - Disparate impact
# - Feature bias
# - Recommendations for fairness

Visualization Types

  1. Feature Importance Bar Chart
  2. SHAP Summary Plot (beeswarm)
  3. SHAP Waterfall (single prediction)
  4. Partial Dependence Plots
  5. Individual Conditional Expectation (ICE)
  6. Force Plots (interactive)
  7. Decision Trees (surrogate models)

Integration with SpecWeave

# Generate all explainability artifacts
/ml:explain-model 0042

# Explain specific prediction
/ml:explain-prediction --increment 0042 --sample sample.json

# Check for bias
/ml:fairness-check 0042

Explainability artifacts automatically included in increment documentation and COMPLETION-SUMMARY.

Best Practices

  1. Generate explanations for all production models - No "black boxes" in production
  2. Check for bias - Test sensitive attributes
  3. Document limitations - What model can't explain
  4. Validate explanations - Do they make domain sense?
  5. Make explanations accessible - Non-technical stakeholders should understand

Model explainability is non-negotiable for responsible AI deployment.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.75%
按下载量换算42

Antigravity

22.88%
按下载量换算33

Cursor

18.44%
按下载量换算27

Gemini CLI

12.19%
按下载量换算18

OpenCode

8.19%
按下载量换算12

Codex

3.18%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills