This message was deleted.
# neural-forecast
s
This message was deleted.
m
Hi @Antoine SCHWARTZ -CROIX-, thanks for using Nixtla. You don't have to modify
stack_types
, you can just do something like this when instantiating the model:
Copy code
model = NBEATSx(h=12, input_size=24,
                #loss=MQLoss(level=[80, 90]),
                loss=DistributionLoss(distribution='Normal', level=[80, 90]),
                scaler_type='robust',
                dropout_prob_theta=0.5,
                stat_exog_list=['airline1'],
                futr_exog_list=['trend'],
                max_steps=200,
                val_check_steps=10,
                early_stop_patience_steps=2)
And then:
Copy code
nf = NeuralForecast(
    models=[model],
    freq='M'
)
nf.fit(df=Y_train_df, static_df=AirPassengersStatic, val_size=12)
Y_hat_df = nf.predict(futr_df=Y_test_df)
The idea is to have a more agnostic use of exogenous variables. For example, to include ex. variables in an NHITS you would do something like:
Copy code
horizon = 24 # day-ahead daily forecast
models = [NHITS(h = horizon,
                input_size = 5*horizon,
                futr_exog_list = ['gen_forecast', 'week_day'], # <- Future exogenous variables
                hist_exog_list = ['system_load'], # <- Historical exogenous variables
                stat_exog_list = ['market_0', 'market_1'], # <- Static exogenous variables
                scaler_type = 'robust')]
Ref: https://nixtlaverse.nixtla.io/neuralforecast/models.nbeatsx.html https://nixtlaverse.nixtla.io/neuralforecast/examples/exogenous_variables.html
a
Hi @Max (Nixtla), First of all, thank you for your reply. Actually, I'm starting to know the package quite well, and I've already read your tutorials and even explored your source code quite a bit. However, I'm having trouble understanding specifically how NBEATSx behaves with exogenous variables (for TFT or NHITS I have no doubt). I saw in this issue that the implementation on neuralforecast was not yet as complete as the one used in the paper, and in that one the exogenous stacks are specifically filled in! Concretely, I have the impression that none of the additions of this PR can be used without editing the
stack_type
list. Am I missing something? Thanks in advance.
m
I think you are right! @Cristian (Nixtla) should be able to provide further help. I think he might be slower than usual to answer because he is on vacations :)
πŸ™ 1
c
Hi @Antoine SCHWARTZ -CROIX-! A user added a simplified version of the exogenous block in the model a couple of months ago. To use it, you need to modify the
stack_type
parameter and add the
exogenous
stack. You can have how many different stack types as you want, and combine the exogenous with the current interpretable configuration as default.
Note that even if you dont specify the exogenous block, all the other types still use the exogenous variables as inputs to compute the
theta
weights projectors. In fact, we have seen that most of the performance gains of the NBEATSx over NBEATS is gained simply by this version. The exogenous block is mostly helpful if you want to have the decomposition.
a
Great, thanks for your answer @Cristian (Nixtla), it’s already clearer! So I will not use this exogenous block, it will be simpler. I take this opportunity to report a bug with this block: shape problem on this concatenation when using
stat_exog
+
futr_exog
πŸ˜‰
πŸ‘€ 1