ScriptsJul 26, 2026·3 min read

Darts — User-Friendly Time Series Forecasting and Anomaly Detection

A Python library for easy manipulation and forecasting of time series, supporting both classical statistical models and modern deep learning architectures with a unified API.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Darts Overview
Direct install command
npx -y tokrepo@latest install 9fc23920-890f-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

Darts is an open-source Python library developed by Unit8 that makes time series forecasting accessible to both beginners and experts. It wraps a wide range of models — from ARIMA and exponential smoothing to N-BEATS and Temporal Fusion Transformer — behind a consistent, easy-to-use API centered around its own TimeSeries data structure.

What Darts Does

  • Provides a unified fit()/predict() interface across 30+ forecasting models
  • Supports probabilistic forecasting with confidence intervals and quantile predictions
  • Handles multivariate, multi-step, and hierarchical time series natively
  • Includes built-in anomaly detection and scoring modules
  • Offers data preprocessing utilities for scaling, missing value handling, and feature engineering

Architecture Overview

Darts is built around the TimeSeries class, an immutable wrapper over xarray that stores time-indexed data with optional static covariates. Models inherit from base classes (LocalForecastingModel, GlobalForecastingModel) that define the training interface. Deep learning models use PyTorch Lightning under the hood, enabling GPU training, early stopping, and learning rate scheduling out of the box.

Self-Hosting & Configuration

  • Install via pip install darts or pip install "u8darts[all]" for all optional dependencies
  • Use darts[torch] to include PyTorch-based models only
  • Configure deep learning models with pl_trainer_kwargs for PyTorch Lightning options
  • Set num_loader_workers for parallel data loading during training
  • Export trained models with model.save() and reload with Model.load()

Key Features

  • Consistent API across statistical, machine learning, and deep learning models
  • First-class support for covariates (past and future external variables)
  • Backtesting and evaluation with historical_forecasts() and multiple metrics
  • Ensemble models and pipeline composition for stacking approaches
  • Rich plotting utilities built on matplotlib

Comparison with Similar Tools

  • sktime — Broader ML task coverage; Darts focuses on making forecasting simple
  • statsmodels — Lower-level statistical API; Darts wraps statsmodels with a friendlier interface
  • GluonTS — AWS probabilistic forecasting; Darts is framework-agnostic and easier to start
  • Prophet — Single model optimized for business series; Darts offers 30+ model choices
  • NeuralForecast — Pure neural focus; Darts mixes classical and deep models

FAQ

Q: Can Darts handle multiple time series at once? A: Yes. Global models in Darts can be trained on multiple series simultaneously and transfer learned patterns across them.

Q: Does Darts support GPU training? A: Yes. All deep learning models leverage PyTorch Lightning and can be trained on GPUs by passing appropriate trainer kwargs.

Q: What data formats does Darts accept? A: Darts accepts pandas DataFrames, NumPy arrays, or its native TimeSeries objects.

Q: Is Darts suitable for production use? A: Yes. Models can be serialized, and the library supports reproducible pipelines suitable for deployment.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets