Multiple Time Series
Learn how to handle missing values in time series data for accurate forecasting with TimeGPT.
You can pass multiple time series within the same dataset to TimeGPT. We can then make forecasts or detect anomalies on all series simultaneously.
To include multiple series, simply include a unique identifier column. By default, we expect this column to be called unique_id
. The identifier column assigns a value to each series such that we can distinguish between them.
Load Data with Multiple Series
Here is an example of loading a dataset with multiple series inside.
unique_id | ds | y |
---|---|---|
BE | 2016-10-22 | 70.00 |
DE | 2017-10-22 | 19.10 |
FR | 2016-10-22 | 54.70 |
NP | 2018-10-15 | 2.17 |
Multiple-Series Data Preview
Above, we can see that we have four unique series in the dataset, as there are four different values in unique_id
. Note that each series can start at different dates.
To forecast mutliple series, we can simply call:
TimeGPT will produce forecasts for all unique IDs in your DataFrame simultaneously.
Specifying the series identifier column
In the case where unique identifier is not stored in a column called unique_id
, you can specify the name of the column when making a call to TimeGPT:
Exogenous Variables
TimeGPT supports the use of exogenous features. These are variables that are not part of the series you are trying to forecast.
For example, suppose that you are forecasting electricity consumption, which is affected by the temperature outside. In this case, the temperature is an exogenous feature, meaning that you want to use the information from the temperature to forecast the electricity consumption.
In such case, exogenous features can be included as new columns in the dataset. Any additional column to the standard unique_id
, ds
, y
format is considered as an exogenous feature.
Here is an example of loading a dataset with multiple series inside and exogenous features.
unique_id | ds | y | Exogenous1 | Exogenous2 | day_0 | day_1 | day_2 | day_3 | day_4 | day_5 | day_6 |
---|---|---|---|---|---|---|---|---|---|---|---|
BE | 2016-10-22 | 70.00 | 57253.00 | 49593 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
DE | 2017-10-22 | 19.10 | 16972.75 | 15779 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 |
FR | 2016-10-22 | 54.70 | 57253.00 | 49593 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
NP | 2018-10-15 | 2.17 | 34078.00 | 1791 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
Multiple-Series with Exogenous Features Preview
Above, we can see that we have the columns from Exogenous1
to day_6
will be considered as exogenous features when forecasting with TimeGPT.
For more information on forecasting with exogenous features, read the Exogenous Variables tutorial for further details.