Data Preparation and Model Evaluation
-
Holding Out Whole Groups for Evaluation
A group split keeps related observations on the same side of a training and evaluation boundary when future predictions concern new groups.
-
Evaluating Predictions in Time Order
For a future prediction task, training data and preprocessing should be limited to information available before each tested prediction time.
-
Fitting Preprocessing on Training Data
Any transformation that estimates parameters from examples needs a fitting boundary. Reuse those fitted parameters when transforming held-out inputs.
-
Substitution and Flags for Missing Features
A missing feature can be represented by a chosen replacement and a separate indication of absence where the model and domain support it.
-
Checking Rare Class Counts After a Split
A split can leave too few examples of an important class to evaluate it reliably. Record counts and choose a method aligning with intended use.
-
A Confusion Matrix from Four Counts
A binary confusion matrix compares predictions with known labels by counting true positives, false positives, false negatives, and true negatives.
-
Accuracy from Class Counts
Accuracy divides the number of correct predictions by the number of evaluated predictions for a classification task.
-
Precision Among Predicted Positives
Positive-class precision is the fraction of predicted positives that are actually positive under the evaluation labels.
-
Recall Among Actual Positives
Positive-class recall is the fraction of actual positives detected by the model under its current decision rule.
-
Specificity and Correctly Rejected Negatives
Specificity is the fraction of actual negative cases correctly classified as negative. Its complement is the false positive rate when the same denominator is used.
-
Calculating F1 from Precision and Recall
F1 is the harmonic mean of positive precision and recall under the specified convention, so a low value of either lowers the score.
-
Changing the Threshold of a Fixed Classifier
A threshold changes which scores count as a positive prediction. It leaves the underlying scores the same.
-
Macro and Micro Averaging Across Classes
A macro average computes a metric per class and then averages those metrics. A micro average pools underlying counts before computing the metric.
-
RMSE and MAE in the Target's Units
Taking the square root of mean squared error gives a quantity with the target's unit. Its emphasis on larger errors differs from mean absolute error.
-
Relative Prediction Error Near a Zero Target
Dividing a prediction error by the reference magnitude can become unstable or undefined near zero. Choose an evaluation metric suited to the observed values.
-
Interpreting Scores as Probabilities
A numerical classification score can order examples usefully. Interpreting it as a probability requires evidence about observed proportions across scores.
-
Binning Scores for a Calibration Check
A calibration display can group predicted probabilities into intervals and compare the mean predicted probability with the observed positive fraction in each.
-
Checking for Duplicate Examples Across Splits
Repeated copies of one example can make held-out performance look stronger than use on genuinely new inputs.
-
Why Class Prevalence Affects Precision
With fixed true-positive and false-positive rates, changing how common positives are can change the fraction of positive predictions that are correct.
-
Checking When a Feature Became Available
Prediction features should be available at the promised scoring time. Historical tables can hide that distinction when facts were added later.
-
Reporting Model Results by Relevant Groups
A model can have different error patterns across meaningful groups. Compare group counts and metrics under a consistent label and measurement rule.
-
Comparing Models on the Same Examples
A paired comparison evaluates candidate models on identical labelled inputs, making it possible to see which cases changed.
-
Small Evaluation Sets and Metric Resolution
When a test set has few important examples, one changed outcome can move a reported rate substantially.
-
What Rotating Validation Folds Measure
Cross-validation repeats training and evaluation on several partitions so different examples serve as validation under the chosen split rule.
-
Using the Same Feature Transformation at Serving Time
A deployed scoring path should apply preprocessing compatible with training, including the stored statistics and field order.
-
Keep a Baseline on an Unchanged Evaluation Set
A baseline helps explain what a more complex model adds. It needs the same target definition and observed inputs as the candidate.
-
Tuning a Threshold Before the Final Test
A threshold selected to optimize a metric on one set has been tuned to that set. Evaluate the chosen rule on independent data when possible.
-
Changes in Feature Distributions After Deployment
The distribution of an incoming feature may change over time. Comparing distributions can reveal a shift worth investigating.
-
Recording Model and Evaluation Data Versions
A score refers to a particular model, data set, split, and evaluation procedure. Preserve those identifiers together.
-
Reporting a Metric with Its Definition
A metric report should identify numerator, denominator, population, weighting, and the behavior for missing or inapplicable cases where relevant.