unit8co/darts

A python library for user-friendly forecasting and anomaly detection on time series.

What it solves

Darts is a Python library designed to simplify time series forecasting and anomaly detection. It provides a unified interface for a wide range of models, from traditional statistical methods to advanced deep learning architectures, reducing the complexity of implementing and comparing different forecasting strategies.

How it works

The library uses a consistent fit() and predict() API, similar to scikit-learn, allowing users to swap models easily. It supports both univariate and multivariate time series and can handle external data (past and future covariates) and static covariates. Deep learning models are implemented using PyTorch Lightning, enabling GPU/TPU acceleration and custom training loops. For anomaly detection, Darts provides dedicated scorers and detectors, or allows users to wrap existing forecasting models to identify discrepancies between predictions and actual values.

Who it’s for

It is intended for data scientists and ML engineers who need to perform time series analysis, forecasting, and anomaly detection on potentially large datasets containing multiple time series.

Highlights

  • Diverse Model Suite: Includes everything from ARIMA and Exponential Smoothing to N-BEATS and other deep neural networks.
  • Multivariate & Global Models: Supports multivariate series and the ability to train a single model on multiple different time series.
  • Probabilistic Forecasting: Offers support for confidence intervals and estimating parametric distributions or quantiles.
  • Comprehensive Tooling: Includes built-in utilities for backtesting, data processing (scaling, filling missing values), and hierarchical forecast reconciliation.
  • Anomaly Detection: Integrated tools for scoring and detecting anomalies, including compatibility with PyOD.
  • Backend Compatibility: Seamlessly integrates with pandas, polars, numpy, pyarrow, and xarray.