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, An error occurred: Series are too short to compute fitted values #291

Closed Abcxyz0401 closed 1 month ago

Abcxyz0401 commented 2 months ago

I'm currently working on anomaly detection for my data based on the example provided by your team. However, I encountered an error message stating "An error occurred: Series are too short to compute fitted values."

code: anomalies_df = timegpt.detect_anomalies(cleaned_df, time_col='time', target_col='JJI', freq='D', date_features=True) anomalies_df error ApiError: status_code: 500, body: {'status': 500, 'data': None, 'message': 'Request failed with status code 500', 'details': 'An error occurred: Series are too short to compute fitted values., Please contact us at ops@nixtla.io or Azul', 'code': 'B30', 'support': 'If you have questions or need support, please email ops@nixtla.io', 'requestID': '5VD38EFX2L'}

jmoralez commented 2 months ago

Hey. Can you please share which example you're following?

Abcxyz0401 commented 2 months ago

Hi. This example https://docs.nixtla.io/docs/anomaly_detection

jmoralez commented 2 months ago

There's no cleaned_df there. Can you provide a full reproducible example?

Abcxyz0401 commented 2 months ago

cleaned_df

JJI time 0 0.003218 2017-04-01 00:00:00 1 0.003560 2017-04-01 00:00:01 2 0.003385 2017-04-01 00:00:02 ... ... ... 776797 0.004295 2017-04-09 23:45:50 776798 0.004431 2017-04-09 23:45:51

anomalies_df = timegpt.detect_anomalies(cleaned_df, time_col='time', target_col='JJI', freq='D', date_features=True) anomalies_df

Abcxyz0401 commented 2 months ago

I just replaced your data with my data

jmoralez commented 2 months ago

Your frequency isn't daily there, it's second, so you should set freq='S' (or freq='s' if you're using pandas>=2.2)

github-actions[bot] commented 1 month ago

This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.