https://github.com/nixtla logo
#neural-forecast
Title
# neural-forecast
a

Afiq Johari

11/08/2023, 2:43 PM
Going through this tutorial on exogenous variables https://nixtla.github.io/neuralforecast/examples/exogenous_variables.html In this example the
df
contains two
unique_ids
. When the model is fitted, is it building a global model? By global, I would interpret that the model learns from all the different time series (or
unique_ids
) in order to perform the forecast for each
unique_id
?
Copy code
df = pd.read_csv('<https://datasets-nixtla.s3.amazonaws.com/EPF_FR_BE.csv>')
df['ds'] = pd.to_datetime(df['ds'])
df.head()

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')]

nf = NeuralForecast(models=models, freq='H')
nf.fit(df=df,
       static_df=static_df)
j

José Morales

11/08/2023, 3:58 PM
Hey. Yes, neuralforecast trains global models using all series
🙏 1
a

Afiq Johari

11/08/2023, 4:12 PM
@José Morales thanks for the confirmation!