AugmentClaude

LIME Explainer

Explain individual AI predictions for tabular, text, and image data.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/lime-explainer-a5c-ai/ — the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

LIME-based local explanation skill for individual predictions across tabular, text, and image data.

What this skill does

lime-explainer

Overview

LIME-based local explanation skill for individual predictions across tabular, text, and image data using Local Interpretable Model-agnostic Explanations.

Capabilities

  • Tabular data explanations
  • Text classification explanations
  • Image classification explanations
  • Submodular pick for representative samples
  • Custom distance metrics
  • Kernel width tuning
  • Feature discretization
  • Local surrogate model analysis

Target Processes

  • Model Interpretability and Explainability Analysis
  • Model Evaluation and Validation Framework

Tools and Libraries

  • LIME
  • scikit-learn
  • numpy
  • PIL/Pillow (for images)

Input Schema

{
  "type": "object",
  "required": ["modelPath", "dataType", "instancePath"],
  "properties": {
    "modelPath": {
      "type": "string",
      "description": "Path to the trained model or prediction function"
    },
    "dataType": {
      "type": "string",
      "enum": ["tabular", "text", "image"],
      "description": "Type of data to explain"
    },
    "instancePath": {
      "type": "string",
      "description": "Path to instance(s) to explain"
    },
    "tabularConfig": {
      "type": "object",
      "properties": {
        "trainingDataPath": { "type": "string" },
        "featureNames": { "type": "array", "items": { "type": "string" } },
        "categoricalFeatures": { "type": "array", "items": { "type": "integer" } },
        "classNames": { "type": "array", "items": { "type": "string" } }
      }
    },
    "textConfig": {
      "type": "object",
      "properties": {
        "classNames": { "type": "array", "items": { "type": "string" } },
        "splitExpression": { "type": "string" }
      }
    },
    "imageConfig": {
      "type": "object",
      "properties": {
        "segmenter": { "type": "string", "enum": ["quickshift", "slic", "felzenszwalb"] },
        "hideColor": { "type": "string" },
        "numSamples": { "type": "integer" }
      }
    },
    "explainerConfig": {
      "type": "object",
      "properties": {
        "numFeatures": { "type": "integer" },
        "numSamples": { "type": "integer" },
        "kernelWidth": { "type": "number" }
      }
    }
  }
}

Output Schema

{
  "type": "object",
  "required": ["status", "explanations"],
  "properties": {
    "status": {
      "type": "string",
      "enum": ["success", "error"]
    },
    "explanations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instanceId": { "type": "string" },
          "predictedClass": { "type": "string" },
          "predictionProbability": { "type": "number" },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "feature": { "type": "string" },
                "weight": { "type": "number" },
                "contribution": { "type": "string" }
              }
            }
          },
          "localAccuracy": { "type": "number" }
        }
      }
    },
    "visualizations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instanceId": { "type": "string" },
          "plotPath": { "type": "string" }
        }
      }
    }
  }
}

Usage Example

{
  kind: 'skill',
  title: 'Generate LIME explanations for predictions',
  skill: {
    name: 'lime-explainer',
    context: {
      modelPath: 'models/classifier.pkl',
      dataType: 'tabular',
      instancePath: 'data/instances_to_explain.csv',
      tabularConfig: {
        trainingDataPath: 'data/train.csv',
        featureNames: ['age', 'income', 'credit_score'],
        categoricalFeatures: [0, 2],
        classNames: ['reject', 'approve']
      },
      explainerConfig: {
        numFeatures: 10,
        numSamples: 5000
      }
    }
  }
}

Related skills