darts: a unified Python library for time series forecasting and anomaly detection
darts: a unified Python library for time series forecasting and anomaly detection
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 classic statistical methods to modern deep learning architectures, allowing users to easily switch between, combine, and evaluate different forecasting approaches.
How it works
Darts uses a scikit-learn-like API with fit() and predict() functions to maintain consistency across different model types. It supports both univariate and multivariate time series, as well as the integration of past-observed and future-known external data (covariates). Deep learning models are implemented using PyTorch Lightning, enabling GPU/TPU acceleration and custom training loops. The library also includes tools for data processing, backtesting, and hierarchical reconciliation to ensure forecasts are consistent across different levels of a data hierarchy.
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 series.
Highlights
- Unified API: Consistent interface for statistical models (like ARIMA) and deep neural networks (like N-BEATS).
- Multivariate & Global Models: Support for multiple time-varying dimensions and the ability to train a single model on multiple time series.
- Probabilistic Forecasting: Ability to generate confidence intervals and estimate parametric distributions or quantiles.
- Integrated Anomaly Detection: A dedicated module (
darts.ad) for anomaly scorers and detectors, including wrappers for PyOD models. - External Data Support: Support for past-observed, future-known, and static covariates.
- Extensibility: Ability to plug in any scikit-learn compatible model for forecasting.
- Explainability: Support for explaining forecasting models using SHAP values.
Sources
- undefinedunit8co/darts