Model Evaluation
What is model evaluation?
Model evaluation is the process of using quantitative metrics to assess a machine learning model's performance, along with its strengths and weaknesses. It matters both during initial development, to compare candidate models, and after deployment, where it feeds into ongoing model monitoring.
How does evaluation fit into the ML workflow?
Model evaluation sits between building a model and putting it into production:
Train → Validate → Evaluate → Deploy → Monitor
A model trains on one portion of the data, then moves through validation and evaluation before anyone decides it's ready to deploy. Once deployed, the same kinds of metrics carry over into ongoing model monitoring to catch performance decay over time.
Types of model evaluation metrics
Classification metrics
- Accuracy measures the ratio of correct predictions to total predictions.
- Precision measures the proportion of predicted positives that are actually positive, useful when a false positive carries real cost (for example, deciding whether to decrease a customer's credit limit).
- Recall measures the proportion of actual positives the model correctly identifies, useful when missing a positive case is the costlier error, such as failing to flag a fraudulent transaction.
- F1 score balances precision and recall into a single number, useful when both false positives and false negatives carry meaningful cost and neither metric alone tells the full story.
- Confusion matrix breaks down correct and incorrect predictions by class, useful when misclassification costs differ across classes, such as a false negative in a cancer diagnosis.
- Log-loss evaluates a classifier's raw probability output rather than just its final label, functioning as a measure of prediction confidence.
- AUC and ROC curve plot how well a model distinguishes between classes across every possible threshold; a higher area under the curve means better separation between, for example, patients with and without a disease.
Regression metrics
R², Adjusted R², Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and Mean Absolute Error (MAE) are the standard metrics for evaluating models that predict a continuous value rather than a class.
Cross-validation
Cross-validation splits data into multiple train/validation folds rather than a single split, so a model's evaluation metrics reflect performance across several subsets of the data instead of one lucky or unlucky split. It's the standard way to get a reliable estimate of how a model will generalize to new data.
Why model evaluation matters
A model that performs well on training data can still fail in production if the evaluation metric doesn't match the actual cost of being wrong. Choosing precision over recall, for instance, changes which errors a model is optimized to avoid, and that choice should follow from the business consequence of a false positive versus a false negative, not from whichever metric is easiest to compute.
Industry use cases
Financial services. Independent model validation is one of the three pillars retained under SR 26-2: comparing model outputs against real-world results through back-testing and outcomes analysis is a named validation method, not an optional check.
Life sciences. Clinical and regulatory model evaluation typically requires documented performance metrics tied to a specific validation protocol, since a model supporting a clinical decision needs evidence that its accuracy holds on the population it's actually deployed against, not just the training cohort.
Regulated industries tend to weight evaluation more heavily than consumer applications because a wrong prediction carries a compliance or safety consequence, not just a degraded user experience.
FAQ
Which metric should I use: accuracy or precision?
It depends on the cost of errors. Use accuracy when false positives and false negatives carry similar costs. Use precision when a false positive is expensive or harmful, since precision penalizes incorrectly predicted positives more heavily.
What's the difference between model validation and model evaluation?
Validation happens during training, using a held-out data split to tune a model's settings before it's finalized. Evaluation happens after training is complete, using metrics to assess how well the finished model performs.
What's the difference between model evaluation and model monitoring?
Model evaluation typically happens during development to compare and select models. Model monitoring applies similar metrics continuously after deployment to catch performance decay over time.
Can a model have high accuracy but still be a bad model?
Yes. Accuracy can be misleading on imbalanced datasets. A model predicting "no fraud" 100% of the time could show 99% accuracy if fraud is rare, while catching zero actual fraud cases.