How can I use features in statsforecast (e.g. moving average, lags, user defined function)?
fcst = StatsForecast(
m4_daily_train,
models = [(auto_arima,7)],
freq = 'D',
n_jobs = min(len(m4_daily_train.index.unique()),cpu_count())
)
Or is it possible to create the features on my own in a previous step in pandas and use then the total feature table in the fitting like...
df['lag1'] = df['y'].shift(1)
df['day'] = df['timestamp'].dt.day
fcst = StatsForecast(
df,
models = [(auto_arima,7)],
freq = 'D',
n_jobs = min(len(m4_daily_train.index.unique()),cpu_count())
)
You can use exogenous variables in the
statsforecast
by passing the training dataset which includesunique_id
,ds
,y
, andexogenous
variables, and the testing dataset which includesunique_id
,ds
, andfuture exogenous
variable in theforecast
step. For more information about Exogenous Regressors, you can find from official documentation