Nixtla / statsforecast

Lightning ⚡️ fast forecasting with statistical and econometric models.
https://nixtlaverse.nixtla.io/statsforecast
Apache License 2.0
3.97k stars 282 forks source link

Simple example does not work #250

Closed deinega closed 2 years ago

deinega commented 2 years ago

Running simple example:

data = np.array([i for i in range(100)], dtype=np.float32)
df = pd.DataFrame({'y': data})
today = datetime.date.today()
df["ds"] = [today + datetime.timedelta(days=i) for i in range(len(df))]
df["unique_id"] = 0

models=[AutoARIMA(season_length=1)]
forecast = StatsForecast(
    df=df,
    models=models,
    freq='D',
)
forecast.forecast(2)

Observing:

Traceback (most recent call last):
  File "/home/alex/code/test/test.py", line 32, in <module>
    y_df = forecast.forecast(2)
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/core.py", line 405, in forecast
    res_fcsts = self.ga.forecast(models=self.models, h=h, fitted=fitted, X=X, level=level)
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/core.py", line 148, in forecast
    res_i = model.forecast(h=h, y=y_train, X=X_train, X_future=X_f, fitted=fitted, **kwargs)
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/models.py", line 183, in forecast
    mod = auto_arima_f(
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/arima.py", line 1810, in auto_arima_f
    fit = Arima(
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/arima.py", line 1322, in Arima
    tmp = arima(x, order, seasonal, xreg, include_mean, method=method, **kwargs)
  File "/home/alex/code/venv/lib/python3.8/site-packages/statsforecast/arima.py", line 778, in arima
    if method.startswith('CSS'):
AttributeError: 'NoneType' object has no attribute 'startswith'
AzulGarza commented 2 years ago

Hey @deinega. Thanks for letting us know about the issue. In the latest version of StatsForecast (v1.1.0), the problem is solved.

image