<@U03619XRWKD> I have two weeks futr_df, but I ne...
# neural-forecast
y
@Cristian (Nixtla) I have two weeks futr_df, but I need to forecast for 8 weeks. I passed 8 weeks futr_df and worked well. But in you documentation https://nixtla.github.io/neuralforecast/examples/exogenous_variables.html, it says the forecast horizon (h) and len (futr_df) should be equal. I need some clarification on this.
c
Hi @Yalemzewd Nigussie. The horizon defines the number of points to forecast. If you are forecasting 8 values, you need to pass 8 data points in the
futr_df
(per
unique_id
).
We specify it in terms of the horizon (in points) because it does not depend on the sampling frequency. The idea is that for each value you are forecasting you need to have information of the future exogenous.
y
so, H and len (futr_df) should not necessary be the same?
c
h should be the same as
len(futr_df)/df.unique_id.nunique()
you need h values for each time series
but not any h values, they have to correspond to the exact datestamps you are forecasting. As we show in the tutorial
lets say you have the series with historic dates 1,2,3,4,5,6,7,8, and you are forecasting 9,10,11,12. You need to pass the values of the future variables for 9,10,11,12 dates.
y
In this example you provided, h=4, but I passed h=12. I got forecast results. There should be an error message to pop up right?
c
Yes. We recently added a protection for this case, but it is currently only in the main branch of the repository. It is not yet in pip
y
When, you plan that into production?
c
It will be released this week, along other improvements
👍 1
This is the error message you will receive
y
Thanks, for the update