# Darts

> Python library for user-friendly forecasting and anomaly detection on time series, from classical models to deep neural networks.

Darts is an open-source Python library from Unit8 for forecasting and anomaly detection on time series. It provides classical statistical models, machine-learning regressors, deep neural networks and foundation models behind one scikit-learn-style `fit()` and `predict()` interface. The latest listed release is 0.47.0, and the code is published under the Apache 2.0 license.

## What It Is

Darts is a time series toolkit installed with `pip install darts` in a Python 3.10+/3.11+ environment. Users wrap data in a `TimeSeries` object, which can be created from and exported to pandas, polars, numpy, pyarrow, xarray and other backends. They then fit a model and generate forecasts, including probabilistic ones.

## Forecasting Workflow

Models range from baselines and ARIMA, Prophet, exponential smoothing and Theta to N-BEATS, TFT, TiDE and TSMixer. Wrappers cover scikit-learn-compatible regressors and classifiers, Nixtla's StatsForecast and NeuralForecast, and zero-training foundation models such as Chronos-2, TimesFM, TiRex and PatchTST-FM. Darts supports:

- univariate and multivariate series
- past, future and static covariates
- training global models on multiple series
- sample weights
- conformal prediction for calibrated quantile intervals
- hierarchical reconciliation
- backtesting with moving historical windows
- ensembles, metrics, data transformers and SHAP-based explainability

## Anomaly Detection

The `darts.ad` module combines scorers, detectors and aggregators. Users can wrap any forecasting or filtering model to compare predictions with actuals, or apply PyOD detectors to time series through `PyODScorer`. Examples include a k-means scorer with a quantile detector that yields binary anomaly labels. Filtering models include Kalman, Gaussian process and moving-average filters.

## Ecosystem and Documentation

Deep learning models are built on PyTorch Lightning, which supports GPU/TPU training and custom callbacks. MLflow integration tracks and persists forecasting experiments. Documentation includes a quickstart, user guide, API reference, example notebooks and release notes.

## Features
- Forecasting models from ARIMA to deep neural networks behind a fit()/predict() API
- Foundation models requiring no training
- Anomaly detection with scorers, detectors and aggregators
- PyOD integration
- Multivariate and probabilistic forecasting
- Conformal prediction
- Past, future and static covariates
- Global models trained on multiple series
- Hierarchical reconciliation
- Backtesting
- SHAP explainability
- Data processing transformers and metrics
- Filtering models (Kalman, Gaussian process, moving average)
- Built-in datasets
- MLflow integration
- PyTorch Lightning support
- Multiple data backends (pandas, polars, numpy, pyarrow, xarray)

## Integrations
PyTorch Lightning, MLflow, scikit-learn, PyOD, Nixtla StatsForecast, Nixtla NeuralForecast, pandas, polars, numpy, pyarrow, xarray, Prophet, CatBoost, LightGBM, XGBoost

## Platforms
WINDOWS, API, DEVELOPER_SDK

## Pricing
Open Source

## Version
0.47.0

## Links
- Website: https://unit8co.github.io/darts/
- Documentation: https://unit8co.github.io/darts/userguide.html
- Repository: https://github.com/unit8co/darts
- EveryDev.ai: https://www.everydev.ai/tools/darts
