PPristone AcademyDiagnose · Build · Transfer

Related service: Machine Learning Tutoring

Machine learning evaluation

Machine Learning Model Evaluation: Metrics, Splits, and Thresholds

Model evaluation is a claim about future decisions. The metric, data split, threshold, and comparison all have to support the same claim.

Written and reviewed by Edward Mabonga14 minute read
Start with the claim

Name what good performance would make possible.

Before selecting a metric, write the decision the model supports and the cost of each kind of error. A score is meaningful only relative to that operating context.

Also define the comparison. A candidate model should beat a simple baseline and, when relevant, the current process. Statistical improvement that does not change a decision or reduce a meaningful cost may not justify added complexity.

Classification

Separate ranking quality, probability quality, and the final decision.

A classifier can output scores or probabilities, but a product eventually applies a threshold or ranking rule. Precision, recall, specificity, and the confusion matrix describe behavior at a chosen operating point. ROC and precision-recall summaries describe performance across thresholds, but they do not select the operating point for you.

When positive cases are uncommon, report class balance and inspect precision-recall behavior rather than relying on accuracy alone. If probability values will drive costs or downstream actions, examine calibration as well as discrimination.

  • Precision: among predicted positives, how many are positive?
  • Recall: among actual positives, how many are found?
  • Threshold: which score becomes an action?
  • Calibration: does a stated probability match observed frequency?
Classification metric chooser
Metric or viewUse it to answerImportant limitation
AccuracyWhat share of all decisions are correct?Can conceal failure when classes or error costs are imbalanced
PrecisionHow trustworthy is a positive alert?Can rise by finding fewer positives
RecallHow many true positives are found?Can rise by generating many false alerts
F1How do precision and recall balance at one threshold?Hides which error matters more and ignores true negatives
PR curve / PR-AUCHow does positive-class performance change across thresholds?Depends on prevalence and still does not choose the operating threshold
ROC curve / ROC-AUCHow well are positives ranked above negatives across thresholds?Can look reassuring when the positive class is rare
Log loss & calibrationAre probability estimates useful and honest?A good probability score does not define the downstream action
Worked threshold example

The same model can support different decisions at different thresholds.

Consider a hypothetical review system with 1,000 cases, including 50 true positives. At threshold A, the model flags 100 cases and catches 40 positives. Precision is 40%, recall is 80%, and reviewers inspect 60 false positives. At threshold B, it flags 50 cases and catches 30 positives. Precision is 60%, recall is 60%, and reviewers inspect 20 false positives.

Threshold A may be preferable when missed positives are very costly and the team can review 100 cases. Threshold B may be preferable when review capacity is capped near 50 and false alerts carry meaningful cost. The model ranking did not change; the operating decision did.

Hypothetical threshold comparison
Operating pointFlaggedTrue positivesFalse positivesPrecisionRecall
Threshold A100406040%80%
Threshold B50302060%60%
Regression

Choose an error measure whose penalties match the use case.

MAE keeps error in the target's units and weights each absolute deviation linearly. RMSE gives larger errors more influence, which can be appropriate when large misses are especially costly. Percentage metrics can become unstable near zero and should be interpreted with care.

Always inspect residuals and meaningful slices. Two models can have the same average error while one is systematically biased for a region, time period, or range of the target.

Regression metric chooser
MetricUse it whenImportant limitation
MAEEach unit of absolute error carries roughly linear costDoes not emphasize occasional large misses
RMSELarge errors should receive disproportionate weightHarder to interpret as a typical error and sensitive to outliers
You need variance explained relative to a mean baselineCan be negative and does not express error in target units
Percentage errorRelative error is meaningful across the target rangeCan become unstable or misleading near zero
Validation design

Make the evaluation data resemble the model's future.

Cross-validation estimates performance across several held-out folds, but the splitter must respect the data-generating process. Use time-aware splits for temporal forecasting, group-aware splits when related examples must stay together, and stratification when class balance needs preservation.

Model selection uses validation evidence repeatedly. That is why a separate final test set remains useful: it estimates performance after the model family, features, preprocessing, hyperparameters, and threshold have been chosen.

Uncertainty

Report variation, not a score with false precision.

Cross-validation scores, bootstrap intervals, or repeated experiments can show how sensitive the result is to the sample and split. The method should match the data structure; repeated rows or time dependence cannot be wished away by resampling.

Compare differences with their uncertainty and practical consequence. A tiny average advantage may not be stable enough—or valuable enough—to justify a slower or harder-to-operate model.

Slice analysis

Look for concentrated failure behind the aggregate.

Break results down by slices that matter to the product and data collection process: time windows, input quality, device type, geography at an appropriate non-identifying level, or operational segments. Choose slices because they test a risk, not because one happens to look interesting after many comparisons.

For each important slice, record sample size, baseline, metric, and error pattern. Small slices may be too uncertain for strong conclusions, but they can still reveal where more data or a safer fallback is needed.

Evaluation report

Make the result reproducible and decision-ready.

A compact evaluation report should include the target and prediction moment, data window, split rule, baseline, pipeline, primary and secondary metrics, selected threshold, slice findings, uncertainty, and known limitations.

End with a recommendation tied to evidence: deploy with monitoring, run a limited trial, gather missing labels, revise the target, or stop. Honest evaluation sometimes concludes that the current data is not sufficient—and that is a useful result.

What to carry into your next experiment

  • Choose metrics from error costs, not habit.
  • Match the split to how future data arrives.
  • Report thresholds, slices, and uncertainty alongside the headline score.

Frequently asked questions

It can be when classes and error costs are reasonably balanced. When positives are rare or error costs differ, also inspect the confusion matrix, precision, recall, and performance at the threshold the product will use.
Validation evidence guides choices such as features, hyperparameters, model family, and threshold. The test set stays untouched until those choices are fixed and provides the final estimate on held-out data.
Use MAE when a linear penalty and target-unit interpretation fit the decision. Use RMSE when larger errors should receive disproportionate weight. Report more than one view when stakeholders need both interpretations.

Official technical references

Workflow and evaluation guidance was checked against current first-party Google and scikit-learn documentation on August 13, 2026.

Machine learning diagnostic

Find the first weak link in your ML workflow.

A paid diagnostic reviews the problem definition, data, pipeline, evaluation, error analysis, and explanation before recommending a pathway.

Book an ML diagnostic