Nixtla / hierarchicalforecast

Probabilistic Hierarchical forecasting 👑 with statistical and econometric methods.
https://nixtlaverse.nixtla.io/hierarchicalforecast
Apache License 2.0
570 stars 69 forks source link

Saved Prefitted ARIMA Base Forecasts for TourismL #136

Open kdgutier opened 1 year ago

kdgutier commented 1 year ago

It would be convenient to have prefitted ARIMA base forecasts for medium and large datasets on S3.

mergenthaler commented 1 year ago

Concretely this block:

%%capture
if os.path.isfile('Y_hat.csv'):
    Y_hat_df = pd.read_csv('Y_hat.csv')
    Y_fitted_df = pd.read_csv('Y_fitted.csv')

    Y_hat_df = Y_hat_df.set_index('unique_id')
    Y_fitted_df = Y_fitted_df.set_index('unique_id')
else:
    fcst = StatsForecast(
        df=Y_train_df, 
        models=[AutoARIMA(season_length=12)],
        fallback_model=[Naive()],
        freq='M', 
        n_jobs=-1
    )
    Y_hat_df = fcst.forecast(h=12, fitted=True, level=[80])
    Y_fitted_df = fcst.forecast_fitted_values()
    Y_hat_df.to_csv('Y_hat.csv')
    Y_fitted_df.to_csv('Y_fitted.csv')

In this nb: https://github.com/Nixtla/hierarchicalforecast/blob/main/nbs/examples/TourismLarge-Evaluation.ipynb