Overview
GluonTS is a deep learning-based framework for probabilisitc time series modeling and forecasting. As mentioned in the paper, deep learning models improve upon traditional univariate models (e.g. Arima) with their ability to train a single, global model over an entire collection of time series.
Notebook
The use case shown in this notebook involves jointly training and forecasting 152 time series at monthly intervals. The data are originally in CSV format. The DeepAR estimator is applied to the training data, and code for a faster feedforward MLP alternative is provided for reference at the end.
Pseudocode
The following pseudocode represents the general workflow in the Jupyter notebook.
READ raw data
TRANSFORM raw data to wide format where each column is a time series
PARTITION training and testing data
TRANSFORM training and testing data to ListDataset format for GluonTS compatibility
SET GluonTS estimator (e.g. DeepAR)
TRAIN estimator jointly over all time series in training data
PREDICT values jointly for all time series in testing data
PRINT prediction accuracy metrics for each time series
PLOT predictions
Takeaways from my experience getting started
Training and inference for all 152 time series required about 2 minutes in total using the DeepAR estimator and CPUs provided by Google Colab. Using the simple feedforward MLP estimator, the total time was around 7 seconds.
Simple API yet sparse documentation.
Probabilistic forecast intervals combined with deep learning differentiate GluonTS from other machine learning algorithms which are only capable of producing point forecasts.
Despite variance in scale and seasonality across all time series, impressive predictive accuracy was achieved without feature engineering or hyperparameter tuning.