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
2.31k stars 187 forks source link

Issue with non UTC time zone data #392

Closed tracykteal closed 5 months ago

tracykteal commented 5 months ago

A user is trying to forecast with different timezone data, like Indian Timezone data. But that is failing. When they change their data to UTC the same data works fine.

They're doing hourly forecasting, and need to consider timezone or else they get an error of 30 minute for different timezones.

jmoralez commented 5 months ago

Do we have the errors? Could be related to https://github.com/Nixtla/utilsforecast/pull/84, which was fixed in utilsforecast 0.1.10.

sohil4932 commented 5 months ago

@jmoralez Please find errors as below.

complete_df:                           ds unique_id           y
0   2024-06-04 17:00:00+05:30        g2  578.007273
1   2024-06-04 18:00:00+05:30        g2  622.999167
2   2024-06-04 19:00:00+05:30        g2  612.808333
3   2024-06-04 20:00:00+05:30        g2  637.553333
4   2024-06-04 21:00:00+05:30        g2  634.643333
..                        ...       ...         ...
331 2024-06-06 12:00:00+05:30        p2   59.648333
332 2024-06-06 13:00:00+05:30        p2   59.902500
333 2024-06-06 14:00:00+05:30        p2   59.679091
334 2024-06-06 15:00:00+05:30        p2   59.627500
335 2024-06-06 16:00:00+05:30        p2   59.564167

[336 rows x 3 columns]
INFO:nixtla.nixtla_client:Validating inputs...
INFO:nixtla.nixtla_client:Preprocessing dataframes...
/home/codespace/.local/lib/python3.10/site-packages/utilsforecast/preprocessing.py:126: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
  offset = pd.tseries.frequencies.to_offset(freq)
/home/codespace/.local/lib/python3.10/site-packages/utilsforecast/preprocessing.py:179: UserWarning: Some values were lost during filling, please make sure that all your times meet the specified frequency.
For example if you have 'W-TUE' as your frequency, make sure that all your times are actually Tuesdays.
  warnings.warn(
INFO:nixtla.nixtla_client:Restricting input...
INFO:nixtla.nixtla_client:Calling Forecast Endpoint...
INFO:nixtla.nixtla_client:Attempt 1 failed...
INFO:nixtla.nixtla_client:Attempt 2 failed...
INFO:nixtla.nixtla_client:Attempt 3 failed...
INFO:nixtla.nixtla_client:Attempt 4 failed...

If I create Dataframe with UTC timezone it will give me proper predictions.

jmoralez commented 5 months ago

@sohil4932 can you upgrade utilsforecast to 0.1.11 and try again?

sohil4932 commented 5 months ago

Thank you. Yes after updating utilsforecast, I am able to get the response.