Hi all! My question is related to how flexible is...
# neural-forecast
Hi all! My question is related to how flexible is the outcome of N-BEATSx and N-HITS (e.g., if they can be trained with different outcome shapes). I have a dataset which contains, for each timestamp, some relevant variables with their value at the moment, the forecasted value for some other predictors for the next “t” timestamps (2 timestamps in the example picture below) and the target variable for the next “t” timestamps. Something like I show in the picture below. I need to keep this data structure because: 1) The forecasted values for X are updated every time (i.e., A and B are different than A’ and B’ because the latter will have been updated, and probably the forecasted values of X one timestamp in advance will be more reliable than the ones further away in time. Therefore, I do not want to use the last forecast available (in which case A and A' would be the same and I could change the structure of the dataset). 2) The second reason is that by maintaining this structure I can easily compare the model performance with several test sets I have already used with other models. Therefore, my question is: are N-BEATSx and/or N-HITS compatible with making predictions with this shape? In the picture example, if the horizon to predict is 4, the model should predict 4 vectors of 2 elements each. Thank you very much.
Hi @Manuel Chabier Escolá Pérez! If I understand correctly, this is your setting: 1. You have two variables, namely
. 2. At a timestamp
you have previous values and forecasts for both variables. 3. The values of the variables update, so at
the value of
for variable
is A. But then, at
you update the previous value (still in the future, now one timestamp ahead), to A'. Is this setting correct?
In the library you can specify two types of temporal exogenous variables:
. For the former, the model to make a forecast at
can only access historic values
, and for the later it can use both historic and future values, up to
. In this case both variables should be
values, so models can access the forecasts.
Now for the updating problem, there is currently no way to incorporate this behavior during training, as each variable can only have one value at each timestamp. You will need to define the variable, for example, to be the "forecasts of
done at timestamp t" (so taking values A in your diagram and so on).
During inference (test), you can simply create you own for loop to make forecasts at every desired timestamp, and update the values of your variables manually before doing the forecast. So it would be a loop with first updating the data:
, and then calling the
Hope this helps! It is a lot of information so let me know if something is not clear!
Hi Cristian! Thank you very much. What you suggest about the training part was my plan B (i.e., You will need to define the variable, for example, to be the "forecasts of
done at timestamp t"), but I wanted to make sure that there was not another approach. However, I had not thought about the loop for the testing set, and that is a very simple but great idea! I will try it. Thank you very much!