neuralforecast
neuralforecast copied to clipboard
Questions regarding AutoNBEATS/AutoNHITS
I have some questions about AutoNBEATS and AutoNHITS, as mentioned below:
- The forecaster can use this code snippet <model.predict_insample()> to generate the model fitted in sample values, but it gives multiple forecasts for a single period. Do we need to average these forecasts, or is there another way to get the fitted values?
- How do I get the Trend and Seasonality components of the forecasts for the N-BEATS/N-HITS models?
- Can we build the NHITS model using exogenous variables like N-BEATSx?
- How do I decide on the search algorithms? The default is search_alg=BasicVariantGenerator(random_state=1)
Hey @sdmishra123,
Thanks for using the library. Answering your questions:
-
The forecaster can use this code snippet <model.predict_insample()> to generate the model fitted in sample values, but it gives multiple forecasts for a single period. Do we need to average these forecasts, or is there another way to get the fitted values? The
model.predict_insample()
method will generate the in-sample predictions in a rolling window fashion. The reason behind the multiple forecast per period is that for each forecast creation date t, it will generate h time steps horizon forecast [t+1:t+h]. You can filter the necessary horizon depending on your task. For example, if you want the first forecasted step, you would filter t+1 for each forecast creation date t. -
How do I get the Trend and Seasonality components of the forecasts for the NBEATS/NHITS models? This notebook contains an example to extract the decomposition of an NHITS model: https://github.com/Nixtla/neuralforecast/blob/main/nbs/models.nhits.ipynb This notebook contains an example to extract the decomposition of an NBEATS model: https://github.com/Nixtla/neuralforecast/blob/main/nbs/models.nbeats.ipynb
-
Can we build the NHITS model using exogenous variables like N-BEATSx? You can add exogenous variables to NHITS through the parameters of
stat_exog_list
andhist_exog_list
. Here is the exogenous tutorial: https://nixtla.github.io/neuralforecast/examples/exogenous_variables.html -
How do I decide on the search algorithms? The default is search_alg=BasicVariantGenerator(random_state=1) Regarding search algorithms, we recommend you use hyperopt. Here is a tunning tutorial: https://nixtla.github.io/neuralforecast/examples/automatic_hyperparameter_tuning.html
Thanks for your prompt reply! I will look at the links and get back to you if I have any further questions.
What does this error mean? RuntimeError: maximum size for tensor at dimension 2 is 392 but size is 448
My h=56 days and my input_size=392
Hey @sdmishra123,
This error arises when you are trying to use more information than that available in your series.
You can solve it by reducing the number of lags that you are using through the input_size
.
I figured out the problem. I get this error when I pass the historical and future exons parameters in NBEATSx. Can you share the link of code to get the Trend and Seasonality components of the forecasts for the NBEATSx? The above link is for NBEATS
Hello,
Greatly appreciate your help so far! I was able to get the Level/Trend/Seasonal components for my model (NBEATS without exogs) using the link you shared, but I am unable to get the components for my model (NBEATSx with exogs). I keep getting the error - RuntimeError: maximum size for tensor at dimension 2 is 280 but the size is 336 when I run this line of code y_hat = nbeatsx.decompose(dataset=dataset)
Hey @sdmishra123,
Glad to hear that you are able to decompose predictions. Can you report this new problem into its own github issue?
Can you share the link? Because it directed me here.