2. Predictive Analytics

Validation, Baselines and Leakage

Simulate future use before comparing predictive models

Validation, Baselines and Leakage

Validation is a time machine with rules

At each historical prediction origin, reconstruct only information available then. HarborMart’s late-delivery model is trained on orders whose outcomes have matured; its test set contains later completed weeks.

PartitionWeeksPurpose
train1–16estimate model parameters
validation17–20choose features, complexity and threshold
test21–24one final performance audit

If the business has strong seasonality, a single period may be fragile. Use rolling origins and report performance by horizon and regime.

Four leakage routes

LeakageHarborMart exampleRepair
target leakagefinal refund amount predicts late deliveryexclude post-outcome fields
temporal leakagecurrent lifetime orders in a 2024 rowreconstruct as of origin
group leakagesame customer appears in train and random testgroup or time-aware split
preprocessing leakageimputation/scaling fitted before splitfit transforms on training only

Leakage is information unavailable in intended use, not simply a variable highly correlated with the target.

Match the split to deployment

Deployment questionSuitable validation idea
future weeks at known storesforward-chaining time split
new storeshold out stores
new customersgroup by customer identity
next campaign under changed policylater-policy test and stress scenario
rare disruptionstargeted stress set plus ordinary test

No split protects against every shift. Name the intended generalisation.

Baselines before algorithms

For classification, compare with:

  • observed base rate;
  • current business rule;
  • simple interpretable score;
  • capacity-matched random or priority policy.

For forecasting, compare with:

  • last value;
  • seasonal naive value;
  • recent mean;
  • current planner forecast.

A complex model that beats “predict zero” but not the deployed rule has not established incremental value.

Avoid test-set bargaining

Choose model families and hyperparameters on training/validation evidence. Use the test once for the selected pipeline. Repeatedly consulting test performance turns the test into another validation set.

Record every material comparison, including failed models. Otherwise the reported interval ignores the search process.

Evaluation table

DimensionMinimum report
central performanceMAE, log loss or decision loss
uncertaintyinterval across periods/folds or bootstrap unit
stabilityby time, store, channel and relevant group
calibrationpredicted versus observed risk
baselinesame records and metric
stressmissing fields, peaks, policy or price shift
latencywhether output arrives before action

Quick check

A delivery model uses “number of support contacts in the next 24 hours.” It will be available before the weekly management meeting. Is it valid?

Answer
Only if the intended prediction is made after those 24 hours. It is invalid for a checkout-time promise decision. Availability must be assessed at the actual action time, not the later reporting meeting.

Next: Regression and Forecasting

Copyright © 2026