Lawfare Group → Knowledge Institute → Lawfare Academy

← Course syllabus · Related lesson

Validate the rule using only information available at the forecast origin

Current complete on-site edition 6

Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative accounting frameworks are distinguished. Independent subject review and observed human learner testing remain pending.

Cumulative regression and forecasting dossier, transfer models and 30-point rubric

Preserved original teaching integrated with complete current on-site preparation. Independent human subject review and observed learner testing remain pending.

Learning objectives

The information set is part of the model

A forecast is a statement issued at a time, for a target and horizon, using an available information set. A dataset assembled after the outcome is known can conceal that contract. A corrected invoice date, revised economic series or eventual customer status may look historical in a spreadsheet while remaining unavailable on the original decision date. Record observation time, availability time and revision policy separately. Begin with the question: what could the analyst actually have known when this forecast was issued?

Reserve a final chronological evaluation period before selecting models. Within the earlier training period, use rolling origins: fit using observations available through an origin, issue a forecast for the specified horizon, advance the origin, and repeat. Expanding windows retain all earlier observations; sliding windows intentionally discard older observations. Neither is universally superior. Explain whether changing relationships justify a limited window, and select that rule using earlier validation rather than the final test outcomes. A one-step evaluation does not establish three-month performance. Reconstruct the intended horizon and update schedule.

All learned preprocessing belongs inside the training boundary: means, scaling parameters, imputations, feature selection, categories and tuning. A variable can be measured before the target yet still be leaked if its cleaned value was produced using future records. A reproducible pipeline saves the transformation fitted at each origin and applies it unchanged to that origin’s held-out observations. The original regression units explain conditional models; this chapter adds the operational test of their use over time.

A deliberately small chronological calculation

Use the synthetic sequence 10,12,11,14,13,16,15,18,17,20 in time order. The first four observations form the initial training sample. A deliberately simple fixed-mean rule uses only their mean, 11.75, for each of the six later targets. Its mean absolute error is 4.75. This rule is valid with respect to availability, although it is a poor forecast for this increasing series. Valid evaluation and useful prediction are separate judgments.

A one-step naive forecast uses the most recently observed value at each origin. Its six forecasts are 14,13,16,15,18,17 and its errors, defined as actual minus forecast, are -1,3,-1,3,-1,3. MAE is 2, mean error is 1, and RMSE is the square root of 5, approximately 2.236. Positive mean error means underprediction under this sign convention. Compare all rules on the same targets, horizon and data revisions.

A leaked fixed rule takes the mean of all ten observations, 14.6, then pretends it was available at the initial origin. On the same six targets its MAE is approximately 2.4333. The apparent improvement over the valid fixed mean incorporates future target information. It still loses to the naive benchmark here, but that does not make the leakage acceptable. Leakage is a defect in the evaluation design, not merely a suspiciously excellent score. The runnable laboratory computes each result independently from the sequence and origin boundaries.

Choose and report the loss before looking for a winner

MAE weights absolute misses linearly; RMSE penalizes larger misses more strongly. Report units, target scaling, horizon, baseline and sample size. Percentage errors become undefined at zero and can behave badly near it; changing a zero to an arbitrary small denominator invents a loss function. A business with asymmetric shortage and surplus costs may need a quantile or cost-weighted forecast rather than the rule with the smallest symmetric average loss. Include the actual operational cost and explain how the forecast is translated into an action.

Rows can also leak across subjects. Repeated transactions from the same customer may require grouped evaluation when the intended deployment is to new customers. Randomly separating nearly identical records answers an easier question. When both time and customer generalization matter, preserve both boundaries and state which population remains untested. Overlapping multi-step forecast errors are dependent; do not apply independent-trial standard errors to their coverage counts without justification.

Repeatedly inspecting a final test and changing the model turns that test into development data. Keep tuning within earlier folds, compare against simple baselines, then evaluate the frozen rule once on the reserved period. Save every issued forecast, not just the successful ones. A final report should distinguish fit residuals, validation errors, final-test errors and subsequent monitoring. If a feature arrives two days late, redesign the same-day model or delay its use; an accurate retrospective column cannot repair an impossible forecast origin.

Worked example: The naive benchmark

Six absolute errors are 1,3,1,3,1,3, summing to 12; MAE=12/6=2. Their squared sum is 30, so RMSE=sqrt(30/6)=sqrt(5). Signed sum 6 gives mean error 1. These are six chronological one-step errors, not six independent replications of every future business condition.

Worked example: A small error can still be invalid evidence

The full-series mean 14.6 gives absolute held-out errors 1.6,1.4,0.4,3.4,2.4,5.4, totaling 14.6 and averaging 2.4333. Its comparison with the valid initial mean’s 4.75 is contaminated by future information. Refit the rule only on available training records before drawing a model-selection conclusion.

Progressive optional practice

Attempt each problem before opening its model. Then revise the reasoning under the changed conditions.

Guided

Why must a scaler be fitted within each training fold?

Compare the model reasoning

Its estimated center and scale summarize observations. Estimating them from future held-out records transfers information across the evaluation boundary.

Changed conditions

The scale is a fixed physical conversion from kilograms to grams.

Compare the revised analysis

An externally fixed conversion is not estimated from the held-out sample; preserve the distinction between a known unit definition and learned preprocessing.

Independent

Is the naive rule unbiased in this six-error sample?

Compare the model reasoning

No under the actual-minus-forecast convention: mean error is +1. That sample diagnostic does not establish the population bias or its uncertainty.

Changed conditions

The business defines error as forecast minus actual.

Compare the revised analysis

All signed errors and mean error reverse sign, while MAE and RMSE remain unchanged.

Transfer

A final test score improves after ten model changes guided by its errors. Can it remain an untouched test?

Compare the model reasoning

No. Disclose the selection, obtain a genuinely later evaluation when possible, and keep further tuning within development data.

Changed conditions

Only a reporting typo was corrected; predictions and selection were frozen.

Compare the revised analysis

A documented clerical correction need not constitute model tuning. Preserve the original predictions and audit exactly what changed.

Preserved historical development snapshot · Course content review

Source readings and scope

Forecasting: Principles and Practice, forecast toolbox — Read sections 5.8 forecast accuracy and 5.10 time-series cross-validation, including training versus test errors and rolling origins. Primary source checked October 27, 2026. The business records and numerical models are original synthetic exercises.

NIST: linear least squares — Review model assumptions and the distinction between fitted relationships and justified prediction. Primary source checked October 27, 2026. The business records and numerical models are original synthetic exercises.

Reproduce the worked examples in Python 3. Standard library only; synthetic data; no production records or network access.