/opt/forecasting-poc/lib/python3.10/site-packages/statsforecast/core.py:492: FutureWarning:
In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
/opt/forecasting-poc/lib/python3.10/site-packages/statsforecast/core.py:1447: FutureWarning:
Passing the ids as the index is deprecated. Please provide them as a column instead.
/opt/forecasting-poc/lib/python3.10/site-packages/statsforecast/core.py:1447: FutureWarning:
Passing the ids as the index is deprecated. Please provide them as a column instead.
/opt/forecasting-poc/lib/python3.10/site-packages/statsforecast/arima.py:829: UserWarning:
some AR parameters were fixed: setting transform_pars = False
/opt/forecasting-poc/lib/python3.10/site-packages/statsforecast/core.py:492: FutureWarning:
In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
forecasts_mstl.head()
ds
MSTL_ARIMA_trend_1
MSTL_ARIMA_trend_1-lo-95
MSTL_ARIMA_trend_1-hi-95
MSTL_HW_trend
MSTL_HW_trend-lo-95
MSTL_HW_trend-hi-95
MSTL_DOT_trend
MSTL_DOT_trend-lo-95
MSTL_DOT_trend-hi-95
MSTL_Holt_trend
MSTL_Holt_trend-lo-95
MSTL_Holt_trend-hi-95
MSTL_AR_trend
MSTL_AR_trend-lo-95
MSTL_AR_trend-hi-95
MSTL_ARIMA_trend_2
MSTL_ARIMA_trend_2-lo-95
MSTL_ARIMA_trend_2-hi-95
unique_id
1
2024-04-23 00:00:00
447210.62500
444114.84375
450306.43750
441782.00000
433129.18750
450434.81250
445456.03125
442295.59375
449220.03125
445482.15625
441707.37500
449256.90625
447665.34375
444598.78125
450731.90625
454678.59375
452427.40625
456929.81250
1
2024-04-23 01:00:00
448354.50000
443145.62500
453563.37500
444155.65625
421518.93750
466792.40625
445100.40625
439725.15625
450135.78125
445124.21875
439785.90625
450462.56250
449133.59375
443669.03125
454598.15625
454491.00000
450708.18750
458273.81250
1
2024-04-23 02:00:00
441677.78125
434246.87500
449108.65625
445304.81250
404940.46875
485669.15625
437529.87500
430476.68750
443777.46875
437551.43750
431013.15625
444089.71875
442690.50000
434685.46875
450695.50000
447848.18750
442430.37500
453266.03125
1
2024-04-23 03:00:00
424103.62500
414574.18750
433633.06250
445594.12500
385722.96875
505465.25000
419549.75000
412234.25000
426818.28125
419569.09375
412019.03125
427119.15625
425196.56250
414771.75000
435621.37500
429126.68750
422157.71875
436095.68750
1
2024-04-23 04:00:00
401796.06250
390396.56250
413195.53125
445355.68750
365746.09375
524965.31250
397128.46875
388371.68750
405360.15625
397145.68750
388704.09375
405587.25000
402821.40625
390242.53125
415400.28125
406840.28125
398481.12500
415199.43750
fc = forecasts_mstl.merge(test, how ="left", on ="ds")fc_performance =Nonefor i in ["MSTL_ARIMA_trend_1", "MSTL_ARIMA_trend_2", "MSTL_HW_trend", "MSTL_DOT_trend", "MSTL_AR_trend", "MSTL_Holt_trend"]: m = mape(y = fc.y, yhat = fc[i]) r = rmse(y = fc.y, yhat = fc[i]) c = coverage(y = fc.y, lower = fc[i +"-lo-95"], upper = fc[i +"-hi-95"]) perf = {"model": i,"mape": m,"rmse": r,"coverage": c}if fc_performance isNone: fc_performance = pd.DataFrame([perf])else: fc_performance = pd.concat([fc_performance, pd.DataFrame([perf])])fc_performance.sort_values("rmse")