Nixtla / nixtla

TimeGPT-1: production ready pre-trained Time Series Foundation Model for forecasting and anomaly detection. Generative pretrained transformer for time series trained on over 100B data points. It's capable of accurately predicting various domains such as retail, electricity, finance, and IoT with just a few lines of code 🚀.
https://docs.nixtla.io
Other
1.91k stars 151 forks source link

ApiError: status_code: 500 #209

Closed LgSouza19 closed 3 months ago

LgSouza19 commented 5 months ago

Getting the following error while trying to run a forecast with country holidays set for Turkey, basic codes below the error.

ApiError: status_code: 500, body: {'data': None, 'message': 'Request failed with status code 500', 'code': 'B30', 'requestID': 'VPXXBHV867', 'support': 'If you have questions or need support, please email ops@nixtla.io'}

        from nixtlats.date_features import CountryHolidays

        date_features=[CountryHolidays(['TR']), 'weekday']
        finetune_steps = 2
        horizon = 30
        timegpt_fcst_df = timegpt.forecast(df=df_chicken_fresh, h=horizon, finetune_steps=finetune_steps, date_features= date_features, time_col='Date', target_col='demand')
kboroz commented 5 months ago

maybe check your data-structure:

print(df.dtypes)

WRONG - Format:

unique_id object ds object y object

y should be float64

RIGHT- Format:

unique_id object ds object y float64

RoelofKuipers commented 4 months ago

I have the same issue:

timegpt_anomalies_df = timegpt.detect_anomalies(df, time_col='ds', target_col='y', freq='15T')
timegpt_anomalies_df.head()
df.info()
DatetimeIndex: 35031 entries, 2023-01-01 00:00:00 to 2023-12-31 23:45:00
Data columns (total 7 columns):
 #   Column                          Non-Null Count  Dtype         
---  ------                          --------------  -----         
 0   y                               35031 non-null  float64       
 1   DRZ (betrieblich) [MW]          35031 non-null  float64       
 2   DRZ (abrechnungsrelevant) [MW]  35031 non-null  float64       
 3   Ungewollter Austausch [MW]      35031 non-null  float64       
 4   TRR für AT [MW]                 35031 non-null  float64       
 5   ds                              35031 non-null  datetime64[ns]

returns: ApiError: status_code: 500, body: {'data': None, 'message': 'Request failed with status code 500', 'code': 'B30', 'requestID': '5433HPFBJY', 'support': 'If you have questions or need support, please email ops@nixtla.io'}

jmoralez commented 4 months ago

Hey @RoelofKuipers. I think this is due to the names of your features, can you try removing the square brackets? e.g. replace TRR für AT [MW] with TRR für AT (MW).

jmoralez commented 3 months ago

This should be fixed now. Feel free to reopen if you encounter this error again.