9.2. Relevant Group Metrics
For classification, possible comparisons include:
True-positive rate
\[
TPR_g = P(\hat Y=1\mid Y=1,G=g).
\]
False-positive rate
\[
FPR_g = P(\hat Y=1\mid Y=0,G=g).
\]
Positive predictive value
\[
PPV_g = P(Y=1\mid\hat Y=1,G=g).
\]
Calibration by group
\[
P(Y=1\mid\hat p=p,G=g)\approx p.
\]
These criteria cannot always be satisfied simultaneously when group base rates differ. Therefore, fairness evaluation requires explicit decisions about the relevant harms and institutional context.
The purpose of modeling is not to produce an elegant fitted function. It is to support reliable understanding and effective action.
Evaluation begins by separating training, model selection, and final assessment. Cross-validation, bootstrap methods, temporal splits, spatial splits, and grouped splits are not interchangeable conventions. They represent different claims about how the model will generalize.
Leakage is among the most dangerous evaluation failures because it can produce strong apparent performance without genuine predictive information. Every operation that learns from data—including scaling, feature selection, imputation, PCA, threshold selection, and hyperparameter tuning—must be contained within the appropriate training partition.
Metrics must match the decision. RMSE and MAE correspond to different error priorities. Accuracy can be meaningless under imbalance. ROC-AUC evaluates ranking but not operational thresholds. Precision, recall, calibration, top-k performance, and expected cost answer different questions. No single metric is universally sufficient.
Debugging requires more than comparing scalar scores. Residual plots reveal nonlinear misspecification, heteroskedasticity, temporal dependence, and subgroup failure. Sensitivity analysis reveals unstable parameters and predictions. Calibration diagnostics reveal whether reported probabilities are trustworthy. Learning curves indicate whether the limiting factor is bias, variance, or insufficient data.
Production evaluation expands the object of analysis from the model to the entire system. Feature pipelines, database joins, software versions, thresholds, human review, latency, and feedback loops can determine whether an apparently strong model succeeds or fails. A production model must therefore be tested and monitored as a data-dependent software system, not merely as a mathematical function.
Stakeholders rarely need every derivation underlying the model. They need clear answers:
- Does it improve the current process?
- What does it cost?
- Which errors remain?
- Who is harmed when it fails?
- How many cases can be processed?
- What evidence supports deployment?
- How will failure be detected?
- How quickly can the system be rolled back?
The strongest final model is not necessarily the most complicated or the most accurate under one benchmark. It is the model whose evidence, decision value, operational behavior, and limitations are understood well enough that the organization can use it responsibly.
Previous chapter: Data Modeling - Clustering