timegpt-1-long-horizon model in TimeGPT.
What is Long-Horizon Forecasting?
Long-horizon forecasting refers to predictions far into the future—typically exceeding two seasonal periods—where uncertainty grows significantly. For instance, forecasting 72 hours ahead is long-horizon for hourly data, two years ahead for monthly data, and over two weeks for daily data.
Key Challenge
Because these forecasts extend far into the future, they may be influenced by unforeseen factors not present in the initial dataset. Hence, long-horizon forecasts generally involve greater risk and uncertainty.
Solution: TimeGPT Model
To address unique challenges, Nixtla provides the specialized
timegpt-1-long-horizon model. Simply specify model="timegpt-1-long-horizon" when calling nixtla_client.forecast.For Interactive Tutorials
Check out our Google Colab notebook to run all code cells interactively.
Check out our Google Colab notebook to run all code cells interactively.
1. Import Packages
Start by installing and importing the required packages, then initialize the Nixtla client:
Import Packages
Use an Azure AI Endpoint
To use an Azure AI endpoint, specify the
To use an Azure AI endpoint, specify the
base_url parameter as well:nixtla_client = NixtlaClient(base_url="your azure ai endpoint", api_key="your api_key")2. Load the Data
We’ll demonstrate long-horizon forecasting using the ETTh1 dataset, which measures oil temperatures and load variations on an electricity transformer in China. Here, we only forecast oil temperatures (
We’ll set our horizon to 96 timestamps (4 days) for testing and use the previous 42 days as input to the model:
y):Load ETTh1 Dataset
Download Progress & Logging
Download Progress & Logging
Download Progress & Logging
Download Progress & Logging
Download Log
Sample Rows
Sample Rows
| unique_id | ds | y | |
|---|---|---|---|
| 0 | OT | 2016-07-01 00:00:00 | 1.460552 |
| 1 | OT | 2016-07-01 01:00:00 | 1.161527 |
| 2 | OT | 2016-07-01 02:00:00 | 1.161527 |
| 3 | OT | 2016-07-01 03:00:00 | 0.862611 |
| 4 | OT | 2016-07-01 04:00:00 | 0.525227 |
Setup Horizon and Input Sequence
3. Forecasting with the Long-Horizon Model
TimeGPT’s
Next, plot the forecast along with 90% confidence intervals:
timegpt-1-long-horizon model is optimized for predictions far into the future. Specify it like so:Forecast with TimeGPT Long-Horizon
Forecast Logging
Forecast Logging
Forecast Log
Models Available in Azure AI
If you access Azure AI services, set
If you access Azure AI services, set
model="azureai":
nixtla_client.forecast(..., model="azureai")Plot Forecast with Confidence Intervals

Congratulations!
You’ve successfully set up a long-horizon forecasting pipeline using TimeGPT. Continue exploring to optimize model parameters, add additional covariates, or integrate Azure AI endpoints.
You’ve successfully set up a long-horizon forecasting pipeline using TimeGPT. Continue exploring to optimize model parameters, add additional covariates, or integrate Azure AI endpoints.