unit8co /darts
A python library for user-friendly forecasting and anomaly detection on time series.
★ 9,589⑂ 1,095👁 62⑃ 1,487● 1,884▤ 66
+0
Daily
9,589
stars
1,095
forks
62
watchers
1,487
prs
1,884
issues
66
releases
README
Time Series Made Easy in Python
!darts
---
!Supported versions
!GitHub Release Date
!GitHub Workflow Status
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. The forecasting models can all be used in the same way,
using fit() and predict() functions, similar to scikit-learn.
The library also makes it easy to backtest models,
combine the predictions of several models, and take external data into account.
Darts supports both univariate and multivariate time series and models.
The ML-based models can be trained on potentially large datasets containing multiple time
series, and some of the models offer a rich support for probabilistic forecasting.
Darts also offers extensive anomaly detection capabilities.
For instance, it is trivial to apply PyOD models on time series to obtain anomaly scores,
or to wrap any of Darts forecasting or filtering models to obtain fully
fledged anomaly detection models.
Documentation
Quickstart
User Guide
API Reference
Examples
High Level Introductions
Introductory Blog Post
Introduction video (25 minutes)
Articles on Selected Topics
Training Models on Multiple Time Series
Using Past and Future Covariates
Temporal Convolutional Networks and Forecasting
Probabilistic Forecasting
Transfer Learning for Time Series Forecasting
Hierarchical Forecast Reconciliation
Quick Install
We recommend to first setup a clean Python environment for your project with Python 3.11+ using your favorite tool
(conda,
venv, virtualenv with
or without virtualenvwrapper).
Once your environment is set up you can install darts using pip:
pip install darts
For more details you can refer to our
installation instructions.
Example Usage
Forecasting
Create a TimeSeries object from a Pandas DataFrame, and split it in train/validation series:
python
import pandas as pd
from darts import TimeSeries
Read a pandas DataFrame
df = pd.read_csv("AirPassengers.csv", delimiter=",")
Create a TimeSeries, specifying the time and value columns
series = TimeSeries.from_dataframe(df, "Month", "Passengers")
Set aside the last 36 months as a validation series
train, val = series[:-36], series[-36:]
Fit an exponential smoothing model, and make a (probabilistic) prediction over the validation series' duration:
python
from darts.models import ExponentialSmoothing
model = ExponentialSmoothing()
model.fit(train)
prediction = model.predict(len(val), num_samples=1000)
Plot the median, 5th and 95th percentiles:
python
import matplotlib.pyplot as plt
series.plot()
prediction.plot(label="forecast", low_quantile=0.05, high_quantile=0.95)
plt.legend()
Anomaly Detection
Load a multivariate series, trim it, keep 2 components, split train and validation sets:
python
from darts.datasets import ETTh2Dataset
series = ETTh2Dataset().load()[:10000][["MUFL", "LULL"]]
train, val = series.split_befoTop issues
#2933Discussion: Foundational / Pre-trained Models in Darts14 comments · 2025-10-20#1945[BUG] Prediction on multiple gpus return results from only one gpu.12 comments · 2023-08-10#2968multi_models = True and output_chunk_length > 1 : index future covariates relatively to the forecasted step9 comments · 2025-12-11#2354GPU Optimization with Num_Workers not working9 comments · 2024-04-26#631Parallelise `backtest()` & `historical_forecasts()`9 comments · 2021-12-01#3349[Bug] ShapExplainer raises ValueError for CatBoostModel with likelihood=multiquantile or gaussian8 comments · 2026-11-07#3051Add `save()` and `load()` methods to`KMeansScorer`8 comments · 2026-03-30#2912Feature request: allow `predict_likelihood_parameters` for auto-regressive `QuantileRegression`8 comments · 2025-09-29
Latest release
Darts patch 0.48.1 0.48.1 2026-10-16We are pleased to announce the release of a new Darts version. You can find a list with all changes in the release notes.