agentleFS
mejbaurbaharmejbaurbahar/fagun/skills/ai-ml-testing/SKILL.md

ai-ml-testing

Skill1 starsChanged 4 months agoMITView on GitHub

Use when testing a classical ML model or ML-powered feature — accuracy/precision/recall/F1 evaluation, model regression testing, bias/fairness testing, and ML pipeline robustness. For LLM/generative-AI-specific testing (prompts, hallucination, RAG), use llm-testing instead.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test predictions across protected/sensitive attribute groups (where legally/ethically appropriate to test) for disparate outcome rates — a …

    line 25
  2. Distinctive:

    Test with adversarial/edge-case inputs specifically constructed to probe known bias patterns for the domain (e.g.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI / ML Testing

Scope note

This skill covers classical/predictive ML (classification, regression, ranking, recommendation models). For generative/LLM-specific concerns (prompt testing, hallucination, RAG), see [[llm-testing]]; for conversational agents built on top, see [[chatbot-voice-agent-testing]].

Core evaluation metrics — use the right one for the problem

  • Accuracy — fraction correct; misleading on imbalanced classes (99% accuracy predicting "not fraud" on a 1%-fraud dataset is a useless model).
  • Precision — of predicted positives, how many were actually positive; matters when false positives are costly (flagging a legit transaction as fraud).
  • Recall — of actual positives, how many were caught; matters when false negatives are costly (missing an actual fraud case).
  • F1 — harmonic mean of precision/recall, useful single number when both matter and classes are imbalanced.
  • AUC-ROC / AUC-PR — threshold-independent view of separability; prefer PR curve over ROC when the positive class is rare. Pick the metric based on the business cost of each error type — report multiple metrics, never just accuracy alone, and always ask what the actual cost asymmetry is if it's not stated.

Model regression testing

  • Maintain a fixed evaluation set (not the live/growing training data) and re-run it on every model version — a metric that improves in aggregate can still regress badly on a specific important slice.
  • Slice-based evaluation: break down metrics by relevant segments (user cohort, input length, language, demographic where applicable for fairness) — an aggregate metric can hide a model that got much worse for a specific group while improving overall.
  • Compare against the previous production model, not just an absolute threshold — "3% accuracy" means nothing without a baseline to compare against.

Bias & fairness testing

  • Test predictions across protected/sensitive attribute groups (where legally/ethically appropriate to test) for disparate outcome rates — a model can be "accurate overall" while systematically disadvantaging a subgroup.
  • Test with adversarial/edge-case inputs specifically constructed to probe known bias patterns for the domain (e.g. name-based bias in resume screening, dialect bias in NLP).
  • This is a domain requiring real expertise beyond automated metrics — flag when a finding needs human fairness/ethics review rather than resolving it purely with a numeric threshold.

Robustness testing

  • Input perturbation: small, realistic changes to input (typos, reordering, noise in image/audio) shouldn't cause wildly different predictions — a model that flips output on a single-character typo is brittle.
  • Adversarial examples: deliberately crafted inputs designed to fool the model — relevant when the model is exposed to potentially adversarial users (spam/fraud detection, content moderation).
  • Out-of-distribution inputs: inputs unlike anything in training data should ideally produce low-confidence outputs or a graceful fallback, not a confident wrong answer.

Pipeline & data testing (often more bugs live here than in the model itself)

  • Training/serving skew: feature computation must be identical between training and serving paths — a common, high-impact bug class where a model performs well offline but poorly in production because a feature is computed differently at inference time.
  • Data drift monitoring: input distribution in production diverging from training distribution degrades model performance silently — needs ongoing monitoring, not a one-time check.
  • Label leakage: a feature that's only available because the outcome already happened (leaking the answer into training) produces unrealistically good offline metrics that won't hold in production — actively look for this in any surprisingly high score.

Reporting

Report metrics with their evaluation set, slice breakdown, and comparison baseline — a bare number ("92% accurate") is not a usable finding. See [[bug-reporting]] and [[test-data-engineering]] for golden-dataset construction discipline.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.