https://github.com/nixtla logo
d

Dawie van Lill

03/23/2023, 1:54 PM
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
hist_exog_list
and
futr_exog_list
components. How would I go about running AutoNHITS with exogenous variables?
k

Kin Gtz. Olivares

03/23/2023, 2:01 PM
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.
c

Cristian (Nixtla)

03/23/2023, 2:09 PM
Hi @Dawie van Lill. We are working on adding the exogenous list directly to the
AutoNHITS
so that users do not need to redefine the config dictionary
d

Dawie van Lill

03/23/2023, 2:18 PM
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?
c

Cristian (Nixtla)

03/23/2023, 2:22 PM
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
futr_exog_list
and
hist_exog_list
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),
    }
d

Dawie van Lill

03/23/2023, 2:30 PM
Thanks! I will try that a bit later and let you know if there are any issues.
k

Kin Gtz. Olivares

03/23/2023, 2:31 PM
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
d

Dawie van Lill

03/23/2023, 2:35 PM
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
k

Kin Gtz. Olivares

03/23/2023, 2:40 PM
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.
d

Dawie van Lill

03/23/2023, 2:43 PM
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.
f

fede (nixtla) (they/them)

03/23/2023, 10:19 PM
hey @Dawie van Lill! Currently, that’s not possible with
MLForecast
, 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
10 Views