When I compare one-step and five-step forecasts, I start by checking where each forecast was made. With a short holdout, the five-step forecast can only be evaluated from earlier origins. Using the same origins for each horizon makes it easier to see which part of the holdout each score describes.
The Python package behind DIY AutoML, UC_AutoMaiL, is now available on the main PyPI index as 0.4.1a2. This example uses a small synthetic series to show how the origins, errors, and interval coverage appear in the saved workbook. The earlier walkthrough used the TestPyPI alpha for an Iris classification example. PyPI release · Earlier Iris walkthrough
Run a comparison on a seasonal series
Use a fresh folder and a Python 3.12 or newer virtual environment.
python -m pip install "uc-automail==0.4.1a2"
python -m uc_automail --version
Save this example as horizons_demo.py and run python horizons_demo.py. The input has a four-observation cycle with a small amount of noise. The candidates include a seasonal naïve forecast and a local-level Kalman forecast, alongside a last-value baseline.
import numpy as np
import pandas as pd
import uc_automail as uc_al
rng = np.random.default_rng(42)
steps = np.arange(160)
season = np.tile([10.0, 20.0, 30.0, 40.0], 40)
values = season + rng.normal(0, 0.5, len(steps))
pd.DataFrame({"step": steps, "value": values}).to_csv("series.csv", index=False)
out = uc_al.forecast_horizons_csv(
"series.csv", "runs/horizons-demo",
time_column="step", value_column="value",
horizons=(1, 3, 5), holdout_rows=24,
models=("seasonal", "kalman"), season_length=4,
interval_method="adaptive", selection_tolerance=0.02,
)
print(out / "report.xlsx")
The last 24 observations form the holdout. The longest forecast goes five steps ahead, so the comparison uses 20 common origins. Within each horizon, the models are evaluated on the same observations. Use a new output path when rerunning the script. Forecast origins and holdout rules
Read the error and interval results together
In this run, the seasonal forecast was selected for each horizon. These are its results on the holdout.
| Steps ahead | Holdout RMSE | Inside the prediction interval |
|---|---|---|
| 1 | 1.007 | 12 of 20 |
| 3 | 1.032 | 16 of 20 |
| 5 | 0.665 | 12 of 20 |
The four-observation cycle was built into this example. The five-step forecast had the lowest RMSE in this run. Its interval covered 12 of 20 observations, the same count as the one-step forecast.
In report.xlsx, start with Selection for the chosen models and Scores for holdout error, coverage, and interval width. Forecasts links each prediction to its origin and target row. Selection_Band records how the 2% tolerance was applied during selection. Interval_Evidence records the completed forecast paths used to update the intervals. Workbook fields and evaluation design
AI was used to draft and edit this article.
Top comments (2)
The counterintuitive result is the best part of this post: the 5-step forecast had the lowest RMSE (0.665) while the 1-step forecast was 1.007 — exactly the opposite of what most people expect from longer horizons. Your explanation makes sense — with a 4-observation cycle built into the synthetic series, the 5-step forecast lands a full cycle plus one ahead, so it rides the seasonal pattern instead of fighting it.
That raises a question I'd love to see you test: how much of this comparison is testing the forecaster, and how much is testing that the seasonal model found the planted cycle? If you changed the cycle to, say, 7 observations, or cranked the noise up, does the 5-step advantage disappear — and does the 3-step interval coverage (16 of 20, the best of the three) hold up? The workbook layout, with Selection_Band and Interval_Evidence alongside the scores, makes that experiment easy to reproduce, which is a nice touch.
Thanks for taking such a close look. Your question made me go back to the individual forecasts.
With a period of 4, seasonal naïve gives exactly the same value for steps 1 and 5 at each shared origin.
Those predictions are scored against observations four rows apart, so they encounter different noise. The period of 4 was supplied in the example.
I reran the comparison with 100 random seeds per setting.
The 5-step RMSE was lower than the 1-step RMSE in 44 runs with the original settings, 50 with a period of 7, and 45 with the original period and 16 times the noise standard deviation.
I also generated a period-7 series and told the seasonal model to use 4.
In that case, the selection rule chose other models at every horizon in all 100 runs.
The 3-step interval had strictly higher coverage than both other horizons in 26 of the 100 runs under the original settings. In the run shown in the post, it covered 16 of 20 observations, and its mean width was 3.04 compared with 1.54 at one step.
This is exactly the kind of question I hoped the workbook would make easier to investigate. Thanks for giving me a reason to put it to the test.