gitmyhub

darts

Python ★ 9.4k updated 1d ago

A python library for user-friendly forecasting and anomaly detection on time series.

A Python library for forecasting future values and spotting unusual data points in any time-ordered sequence, from monthly sales to hourly sensor readings, using a single consistent fit/predict interface across dozens of models.

Pythonpipsetup: moderatecomplexity 3/5

Darts is a Python library for forecasting and anomaly detection on time series data. A time series is any sequence of values recorded over time, such as monthly sales figures, hourly temperature readings, or daily website visits. Darts makes working with this kind of data more approachable by giving all of its forecasting models the same simple interface: you call fit() to train a model on historical data, and predict() to generate future values, the same pattern used by scikit-learn, a popular general-purpose machine learning toolkit.

The library covers a wide range of forecasting approaches in one place. On the simpler end are classical statistical methods like ARIMA and exponential smoothing, which have been used for decades. On the more complex end are deep learning models including N-BEATS and others that can detect patterns across large datasets. Because all models share the same interface, you can swap one out for another without changing much code. The library also supports probabilistic forecasting, meaning instead of a single predicted value it can produce a range of possible outcomes with associated likelihoods.

Anomaly detection is a separate but integrated capability. The darts.ad module lets you build pipelines that score how unusual each point in a series is, then classify points as normal or anomalous. You can feed in results from forecasting models or use external anomaly scoring tools. Both single-variable and multi-variable series are supported throughout the library.

Installing Darts requires Python 3.10 or newer. The basic install is a single pip command. Optional extras add support for additional model types that have heavier dependencies, so you can keep the install lightweight if you only need the simpler models.

The project is maintained by Unit8, a data and AI consulting company. Full documentation including a quickstart guide, user guide, API reference, and worked examples is available on the project website. The full README is longer than what was shown.

Where it fits