Nixtla / statsforecast

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

Auto_Ces "Exception: no model able to be fitted" #830

Open LGsus20 opened 5 months ago

LGsus20 commented 5 months ago

I have around 19,800 values, AutoARIMA, AutoTheta and AutoRegressive work fine, but AutoCES gives this error image

jmoralez commented 5 months ago

Hey @LGsus20, thanks for using statsforecast. Do you have any NaNs in your data? i.e. does Y_df['y'].isnull().sum() return a positive number?

LGsus20 commented 5 months ago

It returns 0

jmoralez commented 5 months ago

Can you provide a small reproducible example (reference)?

LGsus20 commented 5 months ago

Im using pycharm and python 3.10, I didn't have this problem when I was using 13,000 values, I suppose there's a limit on how many values AutoCES can handle. I don't have this problem with AutoARIMA, AutoRegressive, LSTM, PatchTST, AutoETS, AutoLSTM, and AutoTheta

CODE:

from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA, AutoCES
import pandas as pd
import numpy as np

PATH = "https://raw.githubusercontent.com/LGsus20/Weather-Forecasting-Scraping/main/Forecasting_Code/DATASET_Modified_Monthly_2022-2024.csv"
Y_df = pd.read_csv(PATH).assign(unique_id=np.ones(len(pd.read_csv(PATH))))
print("Starting processing")
models = [
#    AutoARIMA(season_length=24),
    AutoCES(season_length=24)
]

sf = StatsForecast(
    models=models,
    freq='h',
    n_jobs=-1
)

Y_hat_df = sf.forecast(df=Y_df, h=6)
sf.fit(df=Y_df)
Y_hat_df = sf.predict(h=6)
Y_hat_df.head(6)