Measure the right kind of error

Different tasks and mistakes need different metrics. A useful metric must match the question you care about.

The idea

A single score is only useful if it measures the mistake you actually care about.

Classification can use confusion-matrix-derived metrics such as precision, recall, or F1; regression can use MAE, MSE/RMSE, R², and related measures depending on the objective.

How it works

  1. Choose held-out predictions from a realistic evaluation split.
  2. Compute task-appropriate metrics.
  3. For score-based classifiers, inspect behavior across thresholds and choose an operating point using validation data and costs.
  4. Check calibration, subgroup performance, uncertainty, and distribution shift when those matter to deployment.

Precision and recall

Precision asks how many predicted positives were truly positive; recall asks how many actual positives were found.

precision = TP/(TP+FP), recall = TP/(TP+FN)

Check your understanding

Why might accuracy alone be misleading on an imbalanced classification dataset?

Answer and explanation

When one class dominates, predicting that class often can produce high accuracy while performing poorly on the minority class.

A common misconception

A high AUC or accuracy does not guarantee useful calibrated probabilities, fair subgroup behavior, or good performance at your chosen operating threshold.

Open Model Evaluation lab

Data & AI Foundations

Understand distributions, projections, evaluation, and explanations so model outputs are easier to reason about.

  1. Describe the data before modeling
  2. Project data onto informative directions
  3. Measure the right kind of error
  4. Explain a prediction without inventing causality