Measuring Model Performance with Evaluation Metrics
This lesson explains how metrics measure how well a model performs, how to choose the metric that reflects the real cost of a mistake, and how to connect technical metrics to business value.
Learning outcomes
After completing this lesson, you will be able to:
- Interpret a confusion matrix.
- Distinguish accuracy, precision, recall, F1 score and AUC.
- Choose a metric from the business cost of each kind of error.
- Identify the metrics used for regression models and for business value.
The confusion matrix
A confusion matrix compares a classification model's predictions with what actually happened. A true positive (TP) is a positive case correctly flagged, such as a fraudulent transaction caught, and a true negative (TN) is a negative case correctly passed. A false negative (FN) is a positive case the model missed, such as fraud that got through, and a false positive (FP) is a false alarm, such as a genuine customer's payment blocked. The following table shows the four outcomes.
| Predicted positive | Predicted negative | |
|---|---|---|
| Actually positive | True positive (TP) | False negative (FN): a miss |
| Actually negative | False positive (FP): a false alarm | True negative (TN) |
Every classification metric is calculated from these four numbers.
The following diagram lays out the four outcomes and the two metrics built from them.

Four outcomes
Classification metrics
Each classification metric answers a different question. Accuracy is the share of all predictions that were correct. It is misleading when one class is rare: if 1% of transactions are fraud, a model that always says "not fraud" is 99% accurate but useless. Precision asks, of everything the model flagged, how much was really positive; it matters when false alarms are costly. Recall, also called sensitivity, asks how many of the real positives the model found; it matters when misses are costly.
The F1 score combines precision and recall into one number, which is useful when classes are imbalanced. AUC-ROC measures how well the model separates the classes across every possible decision threshold, from 0.5 for random guessing to 1.0 for perfect. The following table summarises the metrics.
| Metric | Formula or meaning | Note |
|---|---|---|
| Accuracy | Correct predictions ÷ all predictions | Misleading for imbalanced data: always saying "not fraud" is 99% accurate if 1% is fraud |
| Precision | TP ÷ (TP + FP): how much of what was flagged was really positive | Maximise when false alarms are costly |
| Recall (sensitivity) | TP ÷ (TP + FN): how many real positives were found | Maximise when misses are costly |
| F1 score | Harmonic mean of precision and recall | One balanced number for imbalanced classes |
| AUC-ROC | How well the model separates classes across thresholds | 1.0 is perfect; 0.5 is guessing |
Screening metrics
Choosing by the cost of errors
Which metric to optimise depends on which mistake costs the business more. When missing a positive is expensive, as in fraud detection, cancer screening or finding safety defects, the model should catch as many positives as possible, so it is tuned for recall, accepting more false alarms. When a false alarm is expensive, as when blocking a legitimate customer or deleting a real email as spam, the model should flag only cases it is sure of, so it is tuned for precision, accepting more misses. The following table summarises the choice.
| When this is expensive | Optimise for | Examples |
|---|---|---|
| Missing a positive | Recall | Fraud detection, cancer screening, safety defects |
| A false alarm | Precision | Blocking legitimate customers, deleting real email |
Moving the decision threshold trades one for the other.
Precision or recall?
Regression and business metrics
Regression models predict numbers, so they are judged by how far their predictions are from the true values. MAE (mean absolute error) is the average size of the errors, in the same units as the prediction, such as an average error of $12 on a price. RMSE (root mean squared error) squares the errors before averaging, so it penalises large errors more heavily, which matters when a few big mistakes are worse than many small ones. R² measures how much of the variation in the data the model explains, where values closer to 1 are better. The following table summarises the metrics.
| Metric | Meaning |
|---|---|
| MAE (mean absolute error) | Average size of the errors |
| RMSE (root mean squared error) | Penalises large errors more |
| R² | How much of the variation the model explains; closer to 1 is better |
Business metrics show whether a model is worth having: ROI, cost per user or prediction, development and running cost, revenue or conversion uplift, time saved and customer feedback. A slightly better F1 score is not worth much higher cost.
Judging a regression model
Calculating metrics for a fraud model
A fraud model is tested on 10,000 transactions, of which 100 are really fraudulent. The results form a confusion matrix:
| Predicted fraud | Predicted genuine | |
|---|---|---|
| Actually fraud (100) | TP = 80 | FN = 20 |
| Actually genuine (9,900) | FP = 120 | TN = 9,780 |
Accuracy = (TP + TN) / total = (80 + 9,780) / 10,000 = 98.6%
Precision = TP / (TP + FP) = 80 / (80 + 120) = 40%
Recall = TP / (TP + FN) = 80 / (80 + 20) = 80%
F1 = 2 x P x R / (P + R) = 2 x 0.4 x 0.8 / 1.2 = 53%Accuracy looks excellent, but a model that never flagged anything would score 99%, so accuracy says almost nothing here. Recall shows the model catches 80% of fraud; precision shows that only 40% of its alerts are real fraud, so investigators handle 120 false alarms. If missing fraud is the bigger cost, the bank may accept this; if investigators are overwhelmed, it raises the decision threshold, trading some recall for better precision.
Which metric matters most when missing a positive case is very costly, such as missing a disease?
Show answer
Recall, the share of actual positives the model finds. Precision matters more when false alarms are the costly mistake.
Exam Tips
Remember for the exam
- With imbalanced classes, accuracy is misleading; use precision, recall, F1 or AUC instead.
- When missing positives is costly, as with fraud or disease, optimise for recall.
- When false alarms are costly, optimise for precision.
- To balance precision and recall in a single number, use the F1 score.
- Regression errors are measured with MAE, RMSE and R².
- Business value is measured with ROI, cost per user and conversion.