Hi! I am running a forecast with NHITS and exogeno...
# neural-forecast
Hi! I am running a forecast with NHITS and exogenous variables. The code runs and I get output as expected. However, when I run the code using AutoNHITS for tuning the hyperparameters, the model does not seem to allow for the
components. How would I go about running AutoNHITS with exogenous variables?
Hi @Dawie van Lill , Thanks for using the library. Here is a usage example of the AutoNHITS: https://nixtla.github.io/neuralforecast/examples/longhorizon_with_nhits.html You can feed most of the normal NHITS instantiation parameters through the config dictionary that defines the exploration space.
Hi @Dawie van Lill. We are working on adding the exogenous list directly to the
so that users do not need to redefine the config dictionary
Just to make sure I understand. There is no automated way to do the hyperparemeter tuning with covariates at this stage. I would have to define different config dictionaries and then compare output to determine appropriate values for the hyperparemeters?
Yes it is possible. You need to create the configuration dictionary (example: https://nixtla.github.io/neuralforecast/examples/longhorizon_with_nhits.html) and add the
as any other hyperparamater. For example:
Copy code
nhits_config = {
       "futr_exog_list": tune.choice([YOUR_LIST]), <---------- 
       "learning_rate": tune.choice([1e-3]),
       "max_steps": tune.choice([1000]),
       "input_size": tune.choice([5 * horizon]),
       "batch_size": tune.choice([7]),
       "windows_batch_size": tune.choice([256]),
       "n_pool_kernel_size": tune.choice([[2, 2, 2], [16, 8, 1]]),
       "n_freq_downsample": tune.choice([[168, 24, 1], [24, 12, 1], [1, 1, 1]]),
       "activation": tune.choice(['ReLU']),
       "n_blocks":  tune.choice([[1, 1, 1]]),
       "mlp_units":  tune.choice([[[512, 512], [512, 512], [512, 512]]]),
       "interpolation_mode": tune.choice(['linear']),
       "val_check_steps": tune.choice([100]),
       "random_seed": tune.randint(1, 10),
Thanks! I will try that a bit later and let you know if there are any issues.
You can explore exogeonous in the condig using a list of lists like this: hist_exog_list = [[‘x1’],[‘x1’, ‘x2’]]
👍 1
Let us know how it goes
Just a bit of context, we are attempting to nowcast gross domestic product (we are a group of statisticians and economists) and have tried to use Darts from Unit 8. I came across your package recently and it looked really good so we are trying to see if it is worthwhile moving our workflow. Forecasting with exogenous variables is really important, as we have about 600 covariates. Would be great to get this working
👍 2
Selecting exogenous through hyperparameter exploration might be a bit computationally expensive. the amount of exogenous subsets grows factorially. You might want to consider exploring Lasso regressions too.
Sorry meant 100 covariates, but yes it is expensive.
The code seems to be running, thanks for the help! I will let you know if there are any other issues that arise. So far the experience with NeuralForecast has been great. On a related note, is it possible to include past and future exogenous variables with mlforecast? I didnt see that in the documentation.
hey @Dawie van Lill! Currently, that’s not possible with
, please help us open an issue requesting that feature. We will be happy to work on that 🙂 https://github.com/Nixtla/mlforecast/issues/new?assignees=&amp;labels=&amp;template=feature_request.md