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

Date format? #362

Closed Mohan16071996 closed 4 months ago

Mohan16071996 commented 6 months 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 6 months ago

Can you please respond as soon as possible?

elephaint commented 6 months 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 6 months 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 6 months 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 5 months ago

@Mohan16071996 Is your issue resolved?

github-actions[bot] commented 4 months 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.