agentleFS
HarrypatriaHarrypatria/data-mining-ml/skills/model-evaluation/SKILL.md

model-evaluation

Skill2 starsChanged 12 days agoMITView on GitHub

Model Evaluation. Evaluate classifiers and regressors honestly - confusion matrix, precision, recall, F1, F-beta, MCC, balanced accuracy, ROC-AUC versus PR-AUC on imbalanced data, accuracy paradox, threshold selection with a cost matrix, calibration (Platt, isotonic, Brier score), confidence intervals, slice analysis and fairness metrics, regression metrics (MAE, RMSE, MAPE, pinball loss). Use for model metrics, which metric to use, imbalanced classes, choosing a threshold, model comparison, calibration or fairness checks.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never use 0.5 on imbalanced data without a reason.

    line 23
  2. Distinctive:

    Check with a calibration curve (quantile bins) and Brier score on validation data.

    line 27
  3. Very specific:

    Every headline metric gets an interval: Wilson for recall and precision (state the denominator), stratified bootstrap for PR-AUC, ROC-AUC, …

    line 31

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

Model Evaluation

Choose the headline metric by cost

SituationLead with
Rare, costly misses (fraud, screening)Recall at a fixed precision, PR-AUC, F-beta with beta above 1
Costly false alarms (review queues)Precision at k (k = capacity)
Balanced costsMCC or balanced accuracy
Ranking or targetingLift, cumulative gain, precision at k
Probabilities used directlyLog loss, Brier score, calibration curve
RegressionMAE (robust), RMSE (penalizes large errors), MAPE only when no zeros, pinball loss for quantiles

Accuracy alone is banned on imbalanced data. ROC-AUC alone is banned on rare positives; pair it with PR-AUC and its no-skill floor (the prevalence).

Threshold is a decision

Never use 0.5 on imbalanced data without a reason. Choose on validation data with an explicit cost matrix (mlkit.metrics.choose_threshold(cost_fp=..., cost_fn=...)) or a constraint (min_precision, min_recall). Show the precision-recall trade-off and expected cost per threshold. Compare models at the same operating point, or say they differ.

Calibration

Check with a calibration curve (quantile bins) and Brier score on validation data. Resampled or reweighted models over-predict the minority probability: recalibrate with CalibratedClassifierCV(FrozenEstimator(model), method="isotonic") (or Platt sigmoid for small samples) fitted on untouched validation data.

Uncertainty

Every headline metric gets an interval: Wilson for recall and precision (state the denominator), stratified bootstrap for PR-AUC, ROC-AUC, F1 and MCC (mlkit.metrics.metric_with_intervals). State the positive count; a few dozen positives make intervals wide.

Slices and fairness

Report recall, precision and calibration per important segment with positive counts. For people-facing decisions, pick a fairness definition and say why: equal opportunity (recall parity) when misses harm, predictive parity (precision parity) when false alarms harm, calibration within groups when scores are read as probabilities. Report the gap with intervals.

Multi-class

Report per-class recall and precision, macro averages (each class equal), and say that micro and weighted averages follow the majority class.

Output

Comparison table (baseline, candidates, chosen) at the chosen threshold, intervals, calibration plot, slice table, and one sentence on the decision. Playbook and anti-patterns: references/imbalance-and-metrics.md. Runnable lab: templates/notebooks/imbalance_lab.ipynb.

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.