Separate lead time from the wait for truth
Define forecast targets and mature training labels without confusing observation age, forecast horizon, or feedback delay.
On this page
The question for today
What you’ll understand
- Specify issue time, target interval, and lead time.
- Compute mature training origins under label delay.
- Explain how outcome latency changes evaluation coverage.
A scheduler needs a forecast two hours before a batch reservation begins. Completed demand is finalized three hours after the reservation interval ends. That creates two different clocks: the action needs advance notice, while learning must wait for reliable feedback. Calling both quantities a two-hour forecast hides the label delay and can admit unavailable outcomes into training. Start with the operational decision and target interval, then write the dates at which inputs, predictions, and truth become available. The resulting timeline determines which examples are legal at every retraining cutoff.
Attach the horizon to a decision
Define whether the target is a value at an instant, a sum over an interval, an average rate, or a maximum. Predicting jobs arriving during 16:00–17:00 is different from predicting the queue size at 17:00. Set a convention for horizon, such as target-interval start minus forecast issue time, and carry interval endpoints explicitly. Comparing systems that use different endpoint conventions can make one appear more accurate simply because it sees an extra hour of information.
Separate the operational lead from the distance to the most recent usable measurement. If a forecast is issued at noon for an interval starting at 14:00, its lead is two hours even when the latest usable observation ended at 10:00. The model must bridge four hours from that measurement to the target start. Store the observed input age alongside the forecast lead so delayed pipelines are visible as a separate condition rather than silently reclassified as a harder horizon.
Train only when the label has matured
A training row represents a prediction that could have been issued at its historical origin. Its target may occur later, but the fitting procedure at cutoff C may use that row only if the target label is usable by C. This is different from constructing its feature snapshot: those features must respect the historical origin, not C. One cutoff governs whether the label is available for fitting; the earlier origin governs what the hypothetical predictor was allowed to observe.
For a vector of horizons, decide whether an example waits for every label or uses an explicit per-horizon availability mask. Waiting for all horizons produces a clean rectangular target matrix but discards recently matured short-horizon examples. Masking retains them while requiring a correct loss denominator and careful tracking of which horizons are represented. Neither choice permits treating an unobserved target as zero. Record these masks in training evidence because changing them can change the effective horizon weights.
Score delayed truth without survivor bias
A dashboard showing only labels that have arrived can preferentially report easy cases. For example, healthy jobs may finalize promptly while failed jobs require manual reconciliation. Measure label coverage by issue cohort, horizon, and relevant regime before interpreting accuracy. A score of ten percent error on forty percent of the intended cases is an incomplete result. Keep provisional and final scoring streams separate if the business needs fast feedback while also requiring a stable final benchmark.
Feedback delay also determines realistic adaptation speed. Retraining every fifteen minutes does not create fresh supervision when labels take a day to settle. New input statistics can still be monitored, but prediction error cannot be known before its outcome is observed and accepted. Design alerts for feature freshness and serving failures independently from delayed accuracy alerts. This avoids promising instantaneous detection of a forecasting failure whose consequences have not yet occurred or whose labels have not yet become usable.
Work it through
Compute the last trainable origin
Hourly forecasts issued at origin i predict demand in [i+2,i+3). Final labels become usable three hours after that interval ends. Retraining occurs at 18:00, with equality at the cutoff allowed. Find the latest mature origin and the lead for a forecast issued at noon.
The target interval for a noon issue is [14:00,15:00), so lead to its start is 2 hours and the target duration is 1 hour. These are distinct parts of the request contract.
A row issued at hour i has label time i+2+1+3=i+6. The maturity condition at 18:00 is therefore i+6≤18.
The latest eligible hourly origin is 12:00. Its target ends at 15:00 and finalizes at exactly 18:00. The 13:00 row finalizes at 19:00 and must remain excluded.
The retraining cutoff may consume a noon-origin label while that row’s features remain frozen to what was usable at noon. Later data must not be inserted into its historical inputs.
The living notebook
Explore the model
Interactive lab · modular
Different cadence choices visit different origins
Reset, set Modulus m to 8 and Additive step a to 2. Predict period 4 and residues 2 then 4 after one and two Steps. Reset, set m=8 and a=1, then take two Steps: predict residue 2 and period 8. The instrument advances one discrete addition per Step. This illustrates cadence on a fixed cycle; it does not model labels, finalization, or forecast lead time.
- Residue r0
- 0
- Orbit period · m/gcd(m,a)
- 12
- Distinct residues visited
- 1 of 12
Addition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA schedule’s cadence can change which positions receive decisions, independently of outcome delay.
Pause & reason
Check your understanding
Your turn
Try it yourself
A forecast issued at 08:00 targets the average rate in [11:00,13:00). The latest usable input ended at 07:00, and the label finalizes at 15:00. Compute lead, input-to-target-start gap, interval duration, and issue-to-label delay.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use each pair of endpoints independently; none of the four durations can be inferred from the word horizon alone.
Compare with the solution
Lead is 3 hours, input-to-target-start gap is 4 hours, target duration is 2 hours, and issue-to-label delay is 7 hours. An 08:00-origin training row cannot enter a fit before 15:00 under this finalization policy, even though its feature snapshot is fixed at 08:00.
Keep the idea
Take it with you
- Define target intervals and the horizon convention explicitly.
- Separate historical feature eligibility from training-label maturity.
- Report label coverage before interpreting delayed accuracy.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.