Open j-adamczyk opened 1 week ago
Hello! The error occurs when you fit the model. Here, the combination of length of training set, validation size and horizon cause the training to fail. Basically, your horizon and validation size are likely too large for the amount of data in the training set.
You can try removing the validation set completely or reduce the horizon and that will fix your problem.
I can reduce the validation set, it's no problem. However, I still want to do long horizon predictions. I mean, "long" is not particularly long here, compared to the training data, but I can live with that. I can accept shorter horizons for direct forecast, it's not a problem. However, I have to implement autoregressive forecasting manually then, which is definitely not convenient.
For example, if the model allows forecasting with horizon 128, it's ok, that's quite long. But when I need a forecast of 500, I would have to manually do this in a loop: forecast, append to the input data, forecast, repeat, cut the outputs to the required length. This should be handled by the library underneath, or at least wrapped in a function.
What happened + What you expected to happen
I am performing a pretty standard long-term forecast:
df_test
has length 1480. When I seth
for value over1178
, I get an error:As such, I can't run NBEATS for long-term forecasting. A similar issue has been reported for TimesNet: https://github.com/Nixtla/neuralforecast/issues/1099. Recursive forecast works, but is quite inconvenient.
Versions / Dependencies
Python 3.10.15, Ubuntu 24.04.
Full
pip list
output:Reproduction script
Just run NBEATS example from docs with long data: https://nixtlaverse.nixtla.io/neuralforecast/models.nbeats.html. I used this dataset: https://archive.ics.uci.edu/dataset/611/hierarchical+sales+data.
Code for loading:
Helper functions:
Issue Severity
High: It blocks me from completing my task.