AutoViML / Auto_TS

Automatically build ARIMA, SARIMAX, VAR, FB Prophet and XGBoost Models on Time Series data sets with a Single Line of Code. Created by Ram Seshadri. Collaborators welcome.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Out of sample forecast for SARIMAX

cryptolokimax opened this issue · comments

Hello,

Can you please give an example of out of sample forecast for SARIMAX?

When I try to set a forecast_period, as follows:

predicted = model.predict( testdata=24 )

I get the following error:

Forecast Period is not equal to the number of observations in testdata. The forecast period will be assumed to be the number of observations in testdata.
Out-of-sample forecasting in a model with a regression component requires additional exogenous values via the exog argument.
Model was trained with train dataframe. Please make sure you are passing a test data frame.

Looks like there are 3 messages that contradict each other:

  1. A forecast period I set is wrong (assuming it's ok to set one, it just needs to be equal to number of observations)
  2. I shouldn't use forecast_period, I need to use 'exog' for out of sample forecasting
  3. exog doesnt work either. I should use a data frame, as model was trained with it.

I'm a bit confused, maybe you have an example of forecasting for SARIMAX? Thank you!

The last error message is correct.
"Model was trained with train dataframe. Please make sure you are passing a test data frame."

Since you trained the model with a dataframe, the test data also should be a dataframe.
Please try that option and see.