Kevin Kho
11/10/2022, 3:46 PMforecast
function in the utils can take exogenous regressors?
Code snippet in threadimport pandas as pd
from statsforecast.distributed.utils import forecast
from statsforecast.distributed.fugue import FugueBackend
from statsforecast.models import AutoARIMA
df = pd.read_parquet(f"{WORKING_DIR}/combined.parquet")[["unique_id", "ds", "y","sell_price"]]
result = forecast(df,
models=[AutoARIMA(season_length=7)],
freq="D",
h=7,
parallel=FugueBackend("dask"))
result.compute()
from statsforecast import StatsForecast
df = pd.read_parquet(f"{WORKING_DIR}/combined.parquet")
df = df[["unique_id", "ds", "y","sell_price"]]
model = StatsForecast(
df=df,
models=[AutoARIMA(season_length=7)],
freq='D',
n_jobs=-1
)
model.forecast(7)
fede (nixtla) (they/them)
11/10/2022, 6:46 PMforecast
method to use exogenous variables. That is, the code would be:
model.forecast(7, X_df=future_exogenous)
For example, if you are using weather as an exogenous variable, you must include the weather for the days you generate the forecasts.Kevin Kho
11/10/2022, 6:56 PM