Metrics translate model outputs into decisions. Pick metrics that match costs of false positives vs false negatives—not whatever is default in a tutorial.
Classification metrics
- Accuracy — correct / total (misleading when imbalanced)
- Precision — of predicted positives, how many truly positive
- Recall — of actual positives, how many you caught
- F1 — balance precision and recall
- ROC-AUC — ranking quality across thresholds
Regression metrics
- MAE — mean absolute error (same units as target)
- RMSE — penalizes large errors more
- R² — fraction of variance explained (context-dependent)
Confusion matrix
Table of true/false positives and negatives—read it with stakeholders to choose thresholds (approve loan, send alert).
Business alignment
Fraud: recall often critical. Marketing spam filter: precision may matter more. Always tie metric to dollar or risk impact.
Important interview questions and answers
- Q: Precision vs recall tradeoff?
A: Raising threshold increases precision often but lowers recall—depends on cost of misses. - Q: Accuracy pitfall?
A: 99% negatives → model predicting all negative gets 99% accuracy but useless recall.
Self-check
- When is accuracy misleading?
- Define precision and recall.
- What does MAE measure?
Tip: Pick metrics matching business cost of errors.
Interview prep
- Precision vs recall?
Precision: of predicted positives, how many correct; recall: of actual positives, how many found.