Distribute TimeGPT forecasting jobs on Ray for scalable Python workloads.
Key Concepts
1. Installation
nixtla
library is installed on all workers.2. Load Your Data
unique_id | ds | y | |
---|---|---|---|
0 | BE | 2016-10-22 00:00:00 | 70.00 |
1 | BE | 2016-10-22 01:00:00 | 37.10 |
2 | BE | 2016-10-22 02:00:00 | 37.10 |
3 | BE | 2016-10-22 03:00:00 | 44.75 |
4 | BE | 2016-10-22 04:00:00 | 37.10 |
Preview of the first few rows of data
3. Initialize Ray
Ray Initialization Logs
Log Output
4. Use TimeGPT on Ray
forecast
still apply directly to Ray Dataset objects.Instantiating NixtlaClient
NixtlaClient
. Replace my_api_key_provided_by_nixtla with your own API key.base_url
and api_key
for Azure.Making a Forecast
timegpt-1
(default) and timegpt-1-long-horizon
.Cross-validation with TimeGPT
cv_df
to pandas to view the results:Exogenous Variables
ray_df
in place of a pandas DataFrame.5. Shutdown Ray