Skip to content
Development
Skill

/deployment-explainability

Use when turning a trained model into something usable (an app, an inference function, a demo) or adding explainability. Selects the RIGHT interpretability method per problem: Grad-CAM for CNN image classification, predicted boxes for detection, mask overlays for segmentation,

From plugin
mlcraft
823 skills1 agent1 command

Claude Code

$ npx -y skills add mxslr/mlcraft --skill deployment-explainability --agent claude-code

SKILL.md

deployment-explainability.SKILL.md
name: deployment-explainability
description: "Use when turning a trained model into something usable (an app, an inference function, a demo) or adding explainability. Selects the RIGHT interpretability method per problem: Grad-CAM for CNN image classification, predicted boxes for detection, mask overlays for segmentation, embedding neighbors for face recognition, SHAP for tabular, attributions or attention for text, feature and temporal importance for time-series. Also covers preprocessing parity between training and inference, calibrated scores, out-of-distribution guardrails, and decision-support framing for high-stakes domains. Triggers on 'deploy', 'inference', 'Grad-CAM', 'SHAP', 'saliency', 'explainability', 'feature importance', 'build an app', 'gradio', 'streamlit'."

Deployment and Explainability

Preprocessing PARITY (the bug that silently ruins deployments)

The raw input a user uploads MUST pass through exactly the same pipeline as training (resize, crop, enhancement like CLAHE, normalization). Package it as one shared function reused by both training and inference. A mismatch produces confident but wrong predictions.

Pick the explainability method that fits the model and task

Grad-CAM is only for convolutional image classifiers. It is not meaningful for detection, embeddings, tabular, or text. Choose by problem:

| Model or task | Explainability | Notes | |---|---|---| | CNN image classification | Grad-CAM, Grad-CAM++, Score-CAM | heatmap over the regions that drove the predicted class. Good for medical scans and single-object classification. | | Vision Transformer classification | attention rollout, attention maps | more natural than Grad-CAM for pure ViTs. | | Object detection (faces, vehicles, objects) | draw predicted boxes with class and confidence; optional D-RISE saliency | Grad-CAM is not standard for detectors. The boxes are the explanation. | | Segmentation | overlay the predicted mask on the image, plus per-class confidence | | | Face recognition or verification | nearest-neighbor example faces, embedding similarity score, t-SNE or UMAP of embeddings | Grad-CAM is not meaningful for metric-learning embeddings. | | Tabular | SHAP (global summary and per-prediction), permutation importance | the standard for stakeholder trust. | | Text or NLP | Integrated Gradients, token attributions, attention, SHAP for text | highlight the tokens that drove the decision. | | LLM or RAG output | show the retrieved sources and the rationale; token logprobs for confidence | grounding is the explanation. | | Time-series | feature and lag importance, temporal attention, SHAP on features | which past steps drove the forecast. |

Caption any saliency honestly: it shows where the model looked, not a ground-truth region.

Present the result well

  • Show the calibrated probability or score and the operating threshold, not just a label.
  • For an ensemble, serve the single best model for a coherent prediction and explanation; show the ensemble score as a second opinion.

Guardrails (especially high-stakes)

  • Out-of-distribution check: flag inputs that do not look like the training domain (wrong modality, low confidence) instead of guessing.
  • Framing: for medical or safety uses, state clearly that it is a decision-support or second-reader tool, not autonomous diagnosis. A research prototype needs validation and regulatory clearance before real use.
  • Prefer a high-sensitivity operating point when a miss is far costlier than a false alarm.
  • Log inputs and outputs for audit; never let the model auto-decide irreversible actions.

Packaging

  • Export the chosen model plus the shared preprocessing and an inference function `predict(raw)` that returns the label, the score, and the explanation appropriate to the task.
  • A small Gradio or Streamlit app is the fastest trustworthy demo: drag-drop an input, then show the prediction, the score, the explanation, and the disclaimer. It runs on Colab, Hugging Face Spaces, or locally.
Read more
@mxslr
Ships withmlcraft

A research-first AI/ML research-engineer workflow for Claude Code

823 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8
Star history of mxslr/mlcraft on GitHub, a chart by star-history.com

Other skills on mlcraft.

accuracy-improvement-loop

accuracy-improvement-l…

Use when an existing model's results are disappointing and the user wants higher accuracy - 'accuracy is still too low',…

@mxslr@mxslrInstall Skill
data-rigor-and-leakage

data-rigor-and-leakage

Use BEFORE training any model, to build correct train/val/test splits and hunt data leakage - the #1 cause of fake-high accuracy.…

@mxslr@mxslrInstall Skill
dataset-profiling

dataset-profiling

Use as the FIRST step of any ML task, before choosing a model, to inspect and understand the actual dataset. Works for a LOCAL…

@mxslr@mxslrInstall Skill
domain-3d

domain-3d

Use for 3D and point cloud tasks: point cloud classification, 3D semantic or instance segmentation, 3D object detection from…

@mxslr@mxslrInstall Skill
domain-anomaly-detection

domain-anomaly-detecti…

Use for anomaly, outlier, and novelty detection across data types: industrial or visual defect detection, time-series or sensor…

@mxslr@mxslrInstall Skill
domain-audio-speech

domain-audio-speech

Use for audio and speech tasks: speech recognition (speech to text, ASR, transcription), audio or sound classification and…

@mxslr@mxslrInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about deployment-explainability.

Which coding agents can use deployment-explainability?
deployment-explainability installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.