Skip to main content

Separate pending forecast horizons from evaluated results

2026-11-11 16:36:38.179853+00:00
Separate pending forecast horizons from evaluated results

A forecast whose target date has not occurred has no actual value to compare with its prediction. Keep it pending until the required observation exists. Filling pending actuals with zero creates an error value that measures a placeholder rather than a forecasting result.

Match actuals before scoring

The following example uses synthetic dates and values. One target has an observation and the other is still pending.

predictions = [("2026-01-02", 12.0), ("2026-01-05", 18.0)]
actuals = {"2026-01-02": 10.0}
matched = [(value, actuals[date]) for date, value in predictions if date in actuals]
pending = [date for date, _ in predictions if date not in actuals]
mae = sum(abs(predicted - actual) for predicted, actual in matched) / len(matched) if matched else None
assert mae == 2.0
assert pending == ["2026-01-05"]

The dashboard should display the matched count alongside the error. If nothing has matured, an unavailable score is more informative than a numeric zero. This fixture measures one matched absolute error; it does not establish a model's overall accuracy.

An available matching actual contributes an error sample; an unavailable actual stays outside the score.

Separate pending from missing

A future target is pending. A past target whose source observation failed to arrive is a data-quality problem. Give those states different labels and investigate the missing historical source. Otherwise a broken ingestion job can quietly shrink the evaluated sample while the headline score still looks reassuring.

Match on the actual target definition, including timezone, interval and horizon. A forecast for a daily close cannot be scored against an arbitrary intraday sample just because both share a calendar date. If actual observations can be corrected later, retain the evaluation version or recompute results under a documented policy.

Report by horizon

A one-step forecast and a much later forecast face different uncertainty and often mature at different times. Keep separate sample counts for each horizon. Avoid combining a large set of short-horizon results with a tiny long-horizon set in a way that hides the latter's limited evidence.

Scikit-learn's model evaluation documentation defines error metrics such as mean absolute error. The matching and pending-state policy here is an authored data-handling example. It makes no investment recommendation or claim about achieved returns. For related application context, see the JSLL project overview, whose documented pending horizons should be read separately from evaluated results.