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.9k stars 151 forks source link

Date format? #362

Open Mohan16071996 opened 1 month ago

Mohan16071996 commented 1 month ago

I have data with daily format, not on hourly format.

how to handle this ?

Dataframe example: image

Can you give sample code like this: fcst_df = nixtla_client.forecast(df, h=24, level=[80, 90])

4. Plot your results (optional)

nixtla_client.plot(df, fcst_df, time_col='ds', target_col='y', level=[80, 90])

If it is in daily format, how long can we forecast using this?

Mohan16071996 commented 1 month ago

Can you please respond as soon as possible?

elephaint commented 1 month ago

Hi,

You should specify the frequency parameter:

fcst_df = nixtla_client.forecast(df, h=24, level=[80, 90], freq='D')

See also this tutorial

You might then also want to change the forecast horizon (otherwise it will forecast 24 days ahead....)

Hope this helps.

Mohan16071996 commented 1 month ago

Thanks for your reply. I have used the following configuration now.

3. Forecast the next 248 business days

fcst_df = nixtla_client.forecast(train, h=business_days, freq = 'B' , time_col = 'ds', target_col='Close', add_history=True,level=[80, 90])

What is the maximum horizon that the model can predict accurately. If I try to predict for one year, it gives very bad forecasts. Can you please help with this? I guess, the issue is because, model is written for hourly forecast?

elephaint commented 1 month ago

In the documentation, there is a tutorial on long-horizon forecasting. Thus, you can use a different model when making long-horizon forecasts.

That said, it seems like you try to predict stock prices, which is a non-sensical forecasting task for such a long horizon. It's like trying to predict a random walk. It makes no sense. So results will (obviously) be bad.

elephaint commented 1 month ago

@Mohan16071996 Is your issue resolved?