Metric

A metric is the number used to summarize model behavior under a specific evaluation protocol. A good metric matches the decision that will be made from the model, not just the training loss.

For a test set , a generic metric is:

where is the per-example score.

Classification accuracy is:

Mean absolute error is:

Metric as an Estimator

A reported metric is an estimator of behavior under a target distribution:

The finite test-set estimate is:

This is why split design and confidence intervals matter. A metric can be precisely computed on the wrong test set and still support the wrong claim.

Primary and Diagnostic Metrics

The primary metric decides model selection or headline comparison:

Diagnostic metrics explain failure modes:

Examples include calibration, subgroup error, invalid-output rate, uncertainty coverage, latency, cost, or robustness slices. Diagnostics should not silently become selection criteria after seeing results.

Aggregation

Metric aggregation should match the example unit. Per-row averaging can overweight duplicated molecules, long documents, large protein families, or repeated prompts. Grouped aggregation can be written as:

where is a group such as a target, scaffold, query, protein family, dataset source, or user.

Checks

  • Does the metric match the scientific or product decision?
  • Has the metric been selected using Metric selection rather than habit?
  • Is higher or lower better, and is the scale interpretable?
  • Does class imbalance require AUROC, AUPRC, balanced accuracy, or calibration?
  • Are hard-decision, ranking, probability, and calibration metrics being mixed?
  • Are confidence intervals or multiple seeds needed?
  • Is the metric valid under the chosen split?
  • Is the metric averaged per row, per group, per query, per target, or per task?
  • Are invalid, abstained, timed-out, or failed outputs counted rather than silently dropped?
  • Is the primary metric fixed before model selection?