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.
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.
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?
| Metric or view | Use it to answer | Important limitation |
|---|---|---|
| Accuracy | What share of all decisions are correct? | Can conceal failure when classes or error costs are imbalanced |
| Precision | How trustworthy is a positive alert? | Can rise by finding fewer positives |
| Recall | How many true positives are found? | Can rise by generating many false alerts |
| F1 | How do precision and recall balance at one threshold? | Hides which error matters more and ignores true negatives |
| PR curve / PR-AUC | How does positive-class performance change across thresholds? | Depends on prevalence and still does not choose the operating threshold |
| ROC curve / ROC-AUC | How well are positives ranked above negatives across thresholds? | Can look reassuring when the positive class is rare |
| Log loss & calibration | Are probability estimates useful and honest? | A good probability score does not define the downstream action |
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.
| Operating point | Flagged | True positives | False positives | Precision | Recall |
|---|---|---|---|---|---|
| Threshold A | 100 | 40 | 60 | 40% | 80% |
| Threshold B | 50 | 30 | 20 | 60% | 60% |
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.
| Metric | Use it when | Important limitation |
|---|---|---|
| MAE | Each unit of absolute error carries roughly linear cost | Does not emphasize occasional large misses |
| RMSE | Large errors should receive disproportionate weight | Harder to interpret as a typical error and sensitive to outliers |
| R² | You need variance explained relative to a mean baseline | Can be negative and does not express error in target units |
| Percentage error | Relative error is meaningful across the target range | Can become unstable or misleading near zero |
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.
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.
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.
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
Official technical references
Workflow and evaluation guidance was checked against current first-party Google and scikit-learn documentation on August 13, 2026.