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

Minimum Time Series Length #361

Closed galaxygliese closed 1 week ago

galaxygliese commented 1 month ago

Hi! While using the Forecasting function, the following error message was displayed for a short time series. I think there is no problem in terms of language model Transformers input, but is it difficult to input short data due to the structure of the TimeGPT model? Or, Alternatively, I thought it might be useful to have the ability to mask the first few data to predict shorter data.

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
      7 print(input_df)
      8 
----> 9 fcst_custom_df = nixtla_client.forecast(input_df, h=24, level=[80, 90], time_col='ds', target_col='y')
     10 print(fcst_custom_df)
     11 fcst_custom_df.shape

7 frames
[/usr/local/lib/python3.10/dist-packages/nixtla/nixtla_client.py](https://localhost:8080/#) in validate_input_size(self, Y_df)
    524         min_history = Y_df.groupby("unique_id", observed=True).size().min()
    525         if min_history < self.input_size + self.model_horizon:
--> 526             raise Exception(
    527                 "Your time series data is too short "
    528                 "Please be sure that your unique time series contain "

Exception: Your time series data is too short Please be sure that your unique time series contain at least 144 observations
elephaint commented 1 month ago

Hi,

Are you using the right frequency? You did not set the frequency parameter, so that might cause this issue.

Other than that, we are working on improving our short-term forecasting ability.

github-actions[bot] commented 1 week 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.