Darts: User-Friendly Modern Machine Learning for Time Series

Julien HerzenFrancesco LässigSamuele Giuliano PiazzettaThomas NeuerLéo TaftiGuillaume RailleTomas Van PottelberghMarek PasiekaAndrzej SkrodzkiNicolas Huguenin

article2022JMLR328 citations

Presents Darts, an open-source Python library that unifies classical forecasting methods and modern deep learning architectures under a scikit-learn-like interface supporting multivariate series, multi-series training, and probabilistic forecasting.

Listen

Time series forecasting is critical across multiple industries, including energy, logistics, manufacturing, retail, and healthcare. Although traditional statistical models remain widely used, modern machine learning and deep learning approaches offer greater capacity to handle complex, high-dimensional datasets and multiple time series simultaneously. However, existing software ecosystems often lack unified interfaces, forcing organizations to navigate fragmented tools with steep technical barriers.

The article introduces and evaluates Darts, an open-source Python library designed to democratize modern time series forecasting by bridging classical statistical techniques and advanced deep learning methods under a single, consistent programming interface.

The authors developed a unified software framework centered on an immutable, three-dimensional time series data container. The framework integrates both classical statistical models (such as ARIMA and Exponential Smoothing) and deep learning architectures (including recurrent networks, temporal convolutional networks, and temporal fusion transformers). The evaluation demonstrates the library's ability to train a single model across multiple separate time series, manage external past and future covariates, and execute probabilistic forecasting using Monte Carlo simulations and 17 built-in probability distributions.

Key findings show that Darts standardizes the training and prediction workflow across fundamentally different model families using a single high-level interface. The library natively supports training deep neural networks on collections of multiple time series, significantly reducing data management complexity. Additionally, it provides built-in mechanisms for handling external explanatory data, automated model backtesting, ensembling, and memory-efficient data loading for large-scale datasets.

For organizations, these capabilities mean lower operational costs, shorter development cycles, and reduced implementation risk when deploying advanced forecasting pipelines. Data science teams can seamlessly benchmark classical methods against state-of-the-art neural networks within the same pipeline, accelerating the transition from prototyping to production.

Decision-makers should consider adopting the library as a standardized foundation for enterprise forecasting projects. Technical teams should run pilot evaluations on their own operational datasets to assess performance gains. At the same time, practitioners should note current boundary conditions, as support for static covariates and pre-trained foundation models remains in ongoing development.

Cover for Darts: User-Friendly Modern Machine Learning for Time Series

Abstract

We present Darts¹, a Python machine learning library for time series, with a focus on forecasting. Darts offers a variety of models, from classics such as ARIMA to state-of-the-art deep neural networks. The emphasis of the library is on offering modern machine learning functionalities, such as supporting multidimensional series, fitting models on multiple series, training on large datasets, incorporating external data, ensembling models, and providing a rich support for probabilistic forecasting. At the same time, great care goes into the API design to make it user-friendly and easy to use. For instance, all models can be used using fit()/predict(), similar to scikit-learn (Pedregosa et al., 2011).

Table of Contents

  • 1. Introduction
  • 2. Design Principles and Main Features of Darts
  • 2.1 Time Series Representation
  • 2.2 Unified High-Level Forecasting API
  • 2.3 Training Models on Collections of Time Series
  • 2.4 Support for Past and Future Covariates
  • 2.5 Probabilistic Forecasting
  • 2.6 Other Features
  • 3. Usage Example
  • 4. Conclusions
  • References

Knowls

  1. Knowl 1 — TimeSeries Data Container Representation

    model/method

    In the Darts library, the core abstraction representing time series data is the immutable TimeSeries container class. It encapsulates a 3-dimensional xarray.DataArray structured with dimensions (time, component, sample):

    • time: Indexed by a monotonically sorted time index, supporting either continuous timestamps (pandas.DatetimeIndex) or integer indices (pandas.RangeIndex).
    • component: Represents the dimensions/channels of multivariate series.
    • sample: Represents Monte Carlo stochastic realizations for probabilistic forecasting.

    To ensure data integrity, TimeSeries guarantees well-formed shapes, valid data types, and sorted temporal order upon construction. To optimize memory efficiency and prevent costly deep copies during model training and batching, TimeSeries utilizes NumPy array views while maintaining an immutable external interface. The container provides built-in utilities for conversions (to/from Pandas DataFrames and NumPy arrays), indexing, temporal slicing, differencing, interpolation, applying mapping functions, timestamp feature embedding, and computing marginal empirical quantiles.

  2. Knowl 2 — Unified High-Level Forecasting Interface

    model/method

    Darts establishes a standardized, high-level API inspired by scikit-learn that unifies both classical statistical forecasting algorithms and modern deep neural networks under a single interface.

    All models implement standard methods:

    • fit(series, ...): Trains the model. The input series can be a single TimeSeries object or a Sequence[TimeSeries] representing a collection of multiple distinct series.
    • predict(n, series=None, ...): Generates an out-of-sample forecast for nn future time steps after the end of the specified target series.

    This abstraction covers diverse underlying model mechanics—including autoregressive, recurrent (e.g., DeepAR-like RNNs), sequence-to-sequence, convolutional (e.g., Temporal Convolutional Networks - TCN), transformer-based (e.g., Temporal Fusion Transformers - TFT), basis expansion (e.g., N-BEATS), tabular regression wrappers (e.g., scikit-learn regressors), and classical methods (e.g., ARIMA, VARIMA, AutoARIMA, Exponential Smoothing, Theta, Prophet, FFT)—allowing seamless model comparison, ensembling, and automated backtesting without altering client code.

  3. Knowl 3 — Global Model Training on Multiple Time Series Collections

    model/method

    Unlike classical single-series forecasting methods that require fitting an individual model per time series, Darts supports global model training where a single model is fitted across a dataset comprising many distinct time series.

    Key mechanisms include:

    1. Data Slicing: The darts.utils.data module provides sample generation logic that extracts input and output windows (sub-series chunks) along with associated covariates from a collection of series. Each model architecture provides a default slicing policy that can be customized.
    2. PyTorch Integration: Neural network models are implemented in PyTorch, enabling stochastic gradient descent (SGD) optimization and GPU hardware acceleration.
    3. Lazy Data Loading: For datasets too large to fit in RAM, Darts supports lazy sample extraction through custom PyTorch Sequence and Dataset implementations, streaming slices into memory on-the-fly during mini-batch construction.
  4. Knowl 4 — Past and Future Covariate Differentiation and Alignment

    model/method

    Darts explicitly separates external auxiliary series (covariates) into two distinct semantic categories in model interfaces:

    • Past Covariates (past_covariates): Auxiliary time series whose values are strictly known only up to the time of prediction (e.g., historical sensor readings, measured demand). These cannot be assumed known in the forecast window at inference time.
    • Future Covariates (future_covariates): Auxiliary time series whose future values are known in advance across the entire forecasting horizon nn (e.g., promotional calendars, holidays, weather forecasts).

    Models accept past_covariates and/or future_covariates parameters in their fit() and predict() methods. The library's internal slicing engine automatically aligns the temporal indices of the target series and covariate series based on their respective time axes, eliminating the requirement that input series share identical start or end dates.

  5. Knowl 5 — Monte Carlo Sample Representation for Probabilistic Forecasting

    model/method

    Darts implements probabilistic forecasting without requiring a restrictive parametric form for the joint distribution over time and multivariate components. Instead, distributions are represented empirically via Monte Carlo samples stored along the sample dimension of the TimeSeries container.

    Probabilistic deep neural network architectures optimize parameterized distribution heads via maximum likelihood estimation by minimizing differentiable negative log-likelihood (NLL) loss functions. Features include:

    • Support for continuous, discrete, univariate, and multivariate likelihood distributions (17 distributions available out-of-the-box).
    • Support for specifying time-independent prior distributions over distribution parameters to inject domain beliefs.
    • Efficient vectorized Monte Carlo sampling during inference using batched operations, which produces stochastic TimeSeries objects containing SS realizations that directly support arbitrary quantile extraction (e.g., 10%10\%, 50%50\%, 90%90\%).
  6. Knowl 6 — Time Series Ensembling, Filtering, and Backtesting Utilities

    model/method

    Beyond individual forecasting models, Darts provides a comprehensive ecosystem of modular utilities:

    • Model Ensembling: Allows combining predictions from diverse individual forecasting models (e.g., statistical, tabular, neural), including meta-models that learn ensembling weights using tabular regression models.
    • Filtering Models: Implements probabilistic state-space and filtering techniques, such as Kalman filters and Gaussian Processes, for noise reduction and probabilistic state estimation.
    • Automated Backtesting: A standardized backtest() method on forecasting models to evaluate historical roll-forward predictive accuracy across user-specified metrics.
    • Data Processing and Metrics: Pipelines and scikit-learn-compatible transformers (e.g., Scaler), dynamic time warping (DTW) similarity measures, evaluation metrics, and built-in benchmark datasets via darts.datasets.

Coverage note — None was omitted; all core components, architectural abstractions, API features, and capabilities described in the software paper are fully covered.

References

  1. 1.A. Alexandrov, K. Benidis, M. Bohlke-Schneider, V. Flunkert, J. Gasthaus, T. Januschowski, D. C. Maddix, S. Rangapuram, D. Salinas, J. Schulz, L. Stella, A. C. Turkmen, and Y. Wang. Gluonts: Probabilistic and neural time series modeling in python. Journal of Machine Learning Research, 21(116):1–6, 2020. URL http://jmlr.org/papers/v21/19-820.html.
  2. 2.V. Assimakopoulos and K. Nikolopoulos. The theta model: a decomposition approach to forecasting. International Journal of Forecasting, 16(4):521–530, 2000. ISSN 0169-2070. doi: https://doi.org/10.1016/S0169-2070(00)00066-2. URL https://www.sciencedirect.com/science/article/pii/S0169207000000662. The M3- Competition.
  3. 3.S. Bai, J. Z. Kolter, and V. Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. CoRR, abs/1803.01271, 2018. URL http://arxiv.org/abs/1803.01271.
  4. 4.Beitner et al. Pytorch forecasting. https://github.com/jdb78/pytorch-forecasting. [Online; accessed 27-September-2021].
  5. 5.D. J. Berndt and J. Clifford. Using dynamic time warping to find patterns in time series. In KDD workshop, volume 10, pages 359–370. Seattle, WA, USA:, 1994.
  6. 6.A. Bhatnagar, P. Kassianik, C. Liu, T. Lan, W. Yang, R. Cassius, D. Sahoo, D. Arpit, S. Subramanian, G. Woo, A. Saha, A. K. Jagota, G. Gopalakrishnan, M. Singh, K. C. Krithika, S. Maddineni, D. Cho, B. Zong, Y. Zhou, C. Xiong, S. Savarese, S. Hoi, and H. Wang. Merlion: A machine learning library for time series, 2021.
  7. 7.V. Flunkert, D. Salinas, and J. Gasthaus. Deepar: Probabilistic forecasting with autoregressive recurrent networks. CoRR, abs/1704.04110, 2017. URL http://arxiv.org/abs/1704.04110.
  8. 8.C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, N. J. Smith, R. Kern, M. Picus, S. Hoyer, M. H. van Kerkwijk, M. Brett, A. Haldane, J. F. del R´ıo, M. Wiebe, P. Peterson, P. G´erard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, C. Gohlke, and T. E. Oliphant. Array programming with NumPy. Nature, 585(7825):357–362, Sept. 2020. doi: 10.1038/s41586-020-2649-2. URL https://doi.org/10.1038/s41586-020-2649-2.
  9. 9.Hosseini et al. Linkedin greykite. https://github.com/linkedin/greykite, 2021. [Online; accessed 27-September-2021].
  10. 10.S. Hoyer and J. Hamman. xarray: N-D labeled arrays and datasets in Python. Journal of Open Research Software, 5(1), 2017. doi: 10.5334/jors.148. URL http://doi.org/10.5334/jors.148.
  11. 11.R. Hyndman and G. Athanasopoulos. Forecasting: Principles and Practice. OTexts, Australia, 2nd edition, 2018.
  12. 12.R. J. Hyndman and Y. Khandakar. Automatic time series forecasting: the forecast package for R. Journal of Statistical Software, 26(3):1–22, 2008. URL https://www.jstatsoft.org/article/view/v027i03.
  13. 13.Jiang et al. Facebook kats. https://github.com/facebookresearch/Kats, 2021. [Online; accessed 27-September-2021].
  14. 14.B. Lim, S. O. Arik, N. Loeff, and T. Pfister. Temporal fusion transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting, 37(4):1748–1764, 2021. ISSN 0169-2070. doi: https://doi.org/10.1016/j.ijforecast.2021.03.012. URL https://www.sciencedirect.com/science/article/pii/S0169207021000637.
  15. 15.M. L¨oning, A. J. Bagnall, S. Ganesh, V. Kazakov, J. Lines, and F. J. Kir´aly. sktime: A unified interface for machine learning with time series. CoRR, abs/1909.07872, 2019. URL http://arxiv.org/abs/1909.07872.
  16. 16.B. N. Oreshkin, D. Carpov, N. Chapados, and Y. Bengio. N-BEATS: neural basis expansion analysis for interpretable time series forecasting. CoRR, abs/1905.10437, 2019. URL http://arxiv.org/abs/1905.10437.
  17. 17.B. N. Oreshkin, D. Carpov, N. Chapados, and Y. Bengio. Meta-learning framework with applications to zero-shot time-series forecasting. Proceedings of the AAAI Conference on Artificial Intelligence, 35(10):9242–9250, May 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/17115.
  18. 18.A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019.
  19. 19.F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
  20. 20.T. G. Smith et al. pmdarima: Arima estimators for Python, 2017. URL http://www.alkaline-ml.com/pmdarima. [Online; accessed 27-September-2021].
  21. 21.S. J. Taylor and B. Letham. Forecasting at scale. The American Statistician, 72(1):37–45, 2018.
  22. 22.Wes McKinney. Data Structures for Statistical Computing in Python. In St´efan van der Walt and Jarrod Millman, editors, Proceedings of the 9th Python in Science Conference, pages 56 – 61, 2010. doi: 10.25080/Majora-92bf1922-00a.

Citation

MLA
Herzen, J., et al. “Darts: User-Friendly Modern Machine Learning for Time Series”. Journal of Machine Learning Research, vol. 23, no. 124, 2022, pp. 1–6, https://www.jmlr.org/papers/v23/21-1177.html.
APA
Herzen, J., Lässig, F., Piazzetta, S. G., Neuer, T., Tafti, L., Raille, G., Pottelbergh, T. V., Pasieka, M., Skrodzki, A., Huguenin, N., Dumonal, M., Kościsz, J., Bader, D., Gusset, F., Benheddi, M., Williamson, C., Kosinski, M., Petrik, M., & Grosch, G. (2022). Darts: User-Friendly Modern Machine Learning for Time Series. Journal of Machine Learning Research, 23(124), 1–6. https://www.jmlr.org/papers/v23/21-1177.html
Chicago
Herzen, J., F. Lässig, S. G. Piazzetta, et al. 2022. “Darts: User-Friendly Modern Machine Learning for Time Series”. Journal of Machine Learning Research 23 (124): 1–6. https://www.jmlr.org/papers/v23/21-1177.html.
Harvard
Herzen, J. et al. (2022) “Darts: User-Friendly Modern Machine Learning for Time Series”, Journal of Machine Learning Research, 23(124), pp. 1–6. Available at: https://www.jmlr.org/papers/v23/21-1177.html.
Vancouver
1. Herzen J, Lässig F, Piazzetta SG, et al (2022) Darts: User-Friendly Modern Machine Learning for Time Series. Journal of Machine Learning Research 23:1–6

BibTeX

@article{JMLR:v23:21-1177,
  author  = {Julien Herzen and Francesco Lässig and Samuele Giuliano Piazzetta and Thomas Neuer and Léo Tafti and Guillaume Raille and Tomas Van Pottelbergh and Marek Pasieka and Andrzej Skrodzki and Nicolas Huguenin and Maxime Dumonal and Jan Kościsz and Dennis Bader and Frédérick Gusset and Mounir Benheddi and Camila Williamson and Michal Kosinski and Matej Petrik and Gaël Grosch},
  title   = {Darts: User-Friendly Modern Machine Learning for Time Series},
  journal = {Journal of Machine Learning Research},
  year    = {2022},
  volume  = {23},
  number  = {124},
  pages   = {1--6},
  url     = {http://jmlr.org/papers/v23/21-1177.html}
}
Metadata:DOI registry

Source Code

This paper has an official code repository available. Click below to access the source code.

View Repository

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF
License: https://creativecommons.org/licenses/by/4.0/