Mastering Time Series Forecasting: A Guide to Python’s Most Influential Libraries


The Python ecosystem offers a rich suite of libraries for time series forecasting. Each caters to different needs and comes with its community and popularity, often reflected in the number of GitHub stars. Here’s a rundown of the top libraries, their best use cases, and resources for learning more:

  1. Prophet (Facebook):
  1. pmdarima:
  1. Skforecast:
  1. Greykite (LinkedIn):
  1. Functime:
  1. Arch:

Nixtla’s Suite:

  • StatsForecast:
  • Best for: Rapid computations and high-performance univariate time series forecasting.
  • GitHub Stars: Check Latest
  • Best Article: Nixtla Official Page
  • mlforecast:
  • Best for: Distributed computing environments needing feature engineering at scale.
  • GitHub Stars: Check Latest
  • NeuralForecast:
  • Best for: Leveraging neural networks for time series forecasting, suitable for non-experts.
  • GitHub Stars: Check Latest

Transformers for Time Series:

This curated guide aims to illuminate the path for those exploring the varied landscape of time series forecasting, providing a compass to the tools that resonate most with your project.


Time Series Made Easy in Python: DARTS

Darts is a Python library for user-friendly forecasting and anomaly detection on time series. It contains a variety of models, from classics such as ARIMA to deep neural networks.

Some of the key features of Darts include:

  • A simple and intuitive interface for defining and fitting models
  • Support for different types of time series data, including univariate, multivariate, and panel data
  • A wide range of built-in models, including ARIMA, Exponential Smoothing, Prophet, LSTM, and TCN
  • Tools for hyperparameter tuning and model selection, such as cross-validation and grid search
  • Visualization tools for exploring and analyzing time series data and model outputs

Library

ModelUnivariateMultivariateProbabilisticMultiple series (global)Past-observed covariatesFuture-known covariatesStatic covariatesReference
ARIMA
VARIMA
AutoARIMA
StatsForecastAutoARIMA (faster AutoARIMA)Nixtla’s statsforecast
ExponentialSmoothing
StatsForecastETSNixtla’s statsforecast
BATS and TBATSTBATS paper
Theta and FourThetaTheta & 4 Theta
Prophet (see install notes)Prophet repo
FFT (Fast Fourier Transform)
KalmanForecaster using the Kalman filter and N4SID for system identificationN4SID paper
Croston method
RegressionModel; generic wrapper around any sklearn regression model
RandomForest
LinearRegressionModel
LightGBMModel
CatBoostModel
XGBModel
RNNModel (incl. LSTM and GRU); equivalent to DeepAR in its probabilistic versionDeepAR paper
BlockRNNModel (incl. LSTM and GRU)
NBEATSModelN-BEATS paper
NHiTSModelN-HiTS paper
TCNModelTCN paperDeepTCN paperblog post
TransformerModel
TFTModel (Temporal Fusion Transformer)TFT paperPyTorch Forecasting
DLinearModelDLinear paper
NLinearModelNLinear paper
Naive Baselines