Introduction
GluonTS is an open-source Python library from AWS Labs focused on probabilistic time series forecasting. Unlike point-forecast libraries, GluonTS produces full predictive distributions, giving you not just expected values but also uncertainty quantification. It ships with reference implementations of research models like DeepAR, Temporal Fusion Transformer, and WaveNet.
What GluonTS Does
- Builds probabilistic time series models that output prediction distributions
- Provides reference implementations of DeepAR, TFT, WaveNet, SimpleFeedForward, and more
- Includes a standardized evaluation framework with metrics like CRPS, MASE, and coverage
- Offers built-in datasets from the Monash repository and custom data loading
- Supports both PyTorch and Hugging Face backends for training and inference
Architecture Overview
GluonTS is organized around the concepts of datasets, estimators, predictors, and evaluators. An Estimator defines a model architecture and training procedure. Calling train() produces a Predictor that generates Forecast objects containing sampled trajectories or parametric distributions. The Evaluator compares forecasts against ground truth using probabilistic metrics. Data flows through a transformation pipeline that handles feature engineering, scaling, and batching.
Self-Hosting & Configuration
- Install via
pip install gluonts[torch]for the PyTorch backend - Load benchmark datasets with
get_dataset("m4_hourly")or supply your own viaListDataset - Configure estimators with
prediction_length,freq,context_length, and model-specific hyperparameters - Control training with
trainer_kwargs(epochs, learning rate, batch size, GPU devices) - Serialize predictors with
predictor.serialize(path)for deployment
Key Features
- First-class probabilistic forecasting with distribution outputs and uncertainty estimates
- Comprehensive evaluation metrics designed for probabilistic predictions (CRPS, quantile loss)
- Rich model zoo covering autoregressive, attention-based, and feed-forward architectures
- Modular transformation pipeline for time features, lags, and scaling
- Integration with Amazon SageMaker for scalable cloud training
Comparison with Similar Tools
- Darts — Broader model coverage including statistical; GluonTS goes deeper on probabilistic methods
- Chronos — Pretrained zero-shot model; GluonTS trains models from scratch on your data
- sktime — General time series ML; GluonTS specializes in deep probabilistic forecasting
- Prophet — Single model for business time series; GluonTS offers many model architectures
- NeuralForecast — Nixtla neural models; GluonTS provides more mature probabilistic evaluation tools
FAQ
Q: What is probabilistic forecasting and why does it matter? A: Instead of a single predicted value, probabilistic forecasting provides a distribution over possible futures, enabling risk-aware decision-making.
Q: Can I use GluonTS with GPUs?
A: Yes. Pass GPU device configuration through trainer_kwargs in the estimator.
Q: Does GluonTS support multivariate time series? A: Yes. Models like DeepVAR handle multivariate series natively.
Q: What is the relationship between GluonTS and Amazon Forecast? A: GluonTS is the open-source research toolkit. Amazon Forecast is the managed AWS service. They share some model architectures.