Happy holidays! Can you help me understand how to ...

# neural-forecastj

J T

11/23/2022, 2:31 PMHappy holidays! Can you help me understand how to use nbeats and nhits? as you can see, i have a time series and both models not recognizing the seasonalities. but the autoarima in Nixtla works well with the same data.
here is the code for the two models. anything i need to change?
#note: horizon = 12 month, it’s at the beginning of the month like ‘2022-02-01’
models = [NBEATS(input_size=2 * horizon, h=horizon, max_epochs=50),
NHITS(input_size=2 * horizon, h=horizon, max_epochs=50)]
nforecast = NeuralForecast(models=models,
freq=‘MS’)

k

Kin Gtz. Olivares

11/23/2022, 2:55 PMHi **@J T**,
The way that one can accomodate seasonalities in the NHITS model is through the

`n_freq_downsample`

parameter.
• In your case with monthly data you can try for example `n_freq_downsample=[6,3,1]`

.
• It seems that the scale of your data might be challenging too, you might want to try the `scaler_type='norm'`

to help the optimization of the network (even ReLU nonlinearities might struggle with very large signals).
• You might want to train the network for a bit longer epochs.j

J T

11/23/2022, 4:11 PMJ T

11/23/2022, 4:11 PMJ T

11/23/2022, 4:16 PMi check a post and it seems their nbeats not forecasting seasonality ups an downs either: https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/ar.html

J T

11/23/2022, 4:28 PMalso, how to import AutoNHITS?
from neuralforecast.models import AutoNHITS , AutoNBEATS does not work.

k

Kin Gtz. Olivares

11/23/2022, 4:30 PM Copy code

```
from neuralforecast.auto import (
AutoMLP, AutoNBEATS,
AutoRNN, AutoTCN, AutoDilatedRNN,
)
```

👍 1

Kin Gtz. Olivares

11/23/2022, 4:31 PMI think that the scale might be challenging to the models.
Can you try the Box-Cox transform, taking logarithms of your data and then training the network?

6 Views