You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HyperTreeSTL default forecast fails for short horizons #10
HyperTreeSTL(type="default") fails during forecasting when the forecast horizon is shorter than the learned trend smoothing window / seasonal period. I hit this with fcst_h=3 on a monthly grocery-price example.
Reproduction
Train a default HyperTreeSTL model and forecast with a short horizon, for example:
where test_one has exactly 3 rows and includes the required series_id, date, time, and feature columns.
Observed behavior
Forecasting raises from the default STL forward pass:
RuntimeError: Forecasting not successful: Argument #4: Padding size should be less than the corresponding input dimension
The immediate source is torch.nn.functional.pad(..., mode="reflect") in _forward_default. With fcst_h=3, the input length is 3 but the smoothing window can produce padding such as (7, 7).
There is also a second short-horizon edge case in seasonal centering: when T < period, the existing reflected tail may not be long enough to pad to a full seasonal cycle before view(C, m, N).
Expected behavior
HyperTreeSTL(type="default") should support short forecast horizons such as fcst_h=3 and fcst_h=1, or fail earlier with a clear validation error. Since the model already accepts any positive fcst_h, handling short horizons seems preferable.
Suggested fix
A local patch fixes this by:
capping the default smoothing window by the actual sequence length so reflect padding satisfies pad < T
bypassing smoothing for T <= 1
repeating reflected seasonal values enough times when padding T < period to a full seasonal cycle
adding regression tests for 3-step and 1-step horizons
Activity
StatMixedML commentedon Jul 13, 2026
closed as in #12