Differences in the n_lags parameter #1423
-
Hi, I'm not sure I understand the lagged regressors in the model. What is the difference between running something like m = NeuralProphet(
quantiles=quantiles,
yearly_seasonality=True,
weekly_seasonality="auto",
daily_seasonality="auto",
learning_rate=0.02
)
m.set_plotting_backend("plotly")
m.add_lagged_regressor("traffic_amount", n_lags=24)
metrics = m.fit(df) and m = NeuralProphet(
quantiles=quantiles,
yearly_seasonality=True,
weekly_seasonality="auto",
daily_seasonality="auto",
learning_rate=0.02,
n_lags=24
)
m.set_plotting_backend("plotly")
m.add_lagged_regressor("traffic_amount")
metrics = m.fit(df) specifically what does the n_lags parameter mean when used with the add_lagged_regressor function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @simonsapiel, The |
Beta Was this translation helpful? Give feedback.
Hi @simonsapiel,
The
n_lags=24
set in your second example refers to the series itself - it sets the number of auto-regressive terms.The
m.add_lagged_regressor("traffic_amount", n_lags=24)
line adds an exogenous variable to be regressed over. Here,n_lags=24
sets the number of lagged observations of this variable to be included in the regression. (Ifn_lags
is not set here, it defaults to samen_lags
as set for AR).