Skip to content

Commit 8f03316

Browse files
authored
Merge pull request #431 from unit8co/develop
Release v0.10.0
2 parents 8c36269 + d251992 commit 8f03316

File tree

74 files changed

+7085
-1812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7085
-1812
lines changed

CHANGELOG.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,55 @@
44
Darts is still in an early development phase and we cannot always guarantee backwards compatibility. Changes that may **break code which uses a previous release of Darts** are marked with a "🔴".
55

66
## [Unreleased](https://github.com/unit8co/darts/tree/develop)
7-
[Full Changelog](https://github.com/unit8co/darts/compare/0.9.1...develop)
7+
[Full Changelog](https://github.com/unit8co/darts/compare/0.10.0...develop)
8+
9+
## [0.10.0](https://github.com/unit8co/darts/tree/0.10.0) (2021-08-13)
10+
### For users of the library:
11+
12+
**Added:**
13+
- 🔴 Improvement of the covariates support. Before, some models were accepting a `covariates` (or `exog`)
14+
argument, but it wasn't always clear whether this represented "past-observed" or "future-known" covariates.
15+
We have made this clearer. Now all covariate-aware models support `past_covariates` and/or `future_covariates` argument
16+
in their `fit()` and `predict()` methods, which makes it clear what series is used as a past or future covariate.
17+
We recommend [this article](https://medium.com/unit8-machine-learning-publication/time-series-forecasting-using-past-and-future-external-data-with-darts-1f0539585993)
18+
for more informations and examples.
19+
20+
- 🔴 Significant improvement of `RegressionModel` (incl. `LinearRegressionModel` and `RandomForest`).
21+
These models now support training on multiple (possibly multivariate) time series. They also support both
22+
`past_covariates` and `future_covariates`. It makes it easier than ever to fit arbitrary regression models (e.g. from
23+
scikit-learn) on multiple series, to predict the future of a target series based on arbitrary lags of the target and
24+
the past/future covariates. The signature of these models changed: It's not using "`exog`" keyword arguments, but
25+
`past_covariates` and `future_covariates` instead.
26+
27+
- Dynamic Time Warping. There is a brand new `darts.dataprocessing.dtw` submodule that
28+
implements Dynamic Time Warping between two `TimeSeries`. It's also coming with a new `dtw`
29+
metric in `darts.metrics`. We recommend going over the
30+
[new DTW example notebook](https://github.com/unit8co/darts/blob/master/examples/13-Dynamic-Time-Warping-example.ipynb)
31+
for a good overview of the new functionalities
32+
33+
- Conda forge installation support (fully supported with Python 3.7 only for now). You can now
34+
`conda install u8darts-all`.
35+
36+
- `TimeSeries.from_csv()` allows to obtain a `TimeSeries` from a CSV file directly.
37+
38+
- Optional cyclic encoding of the datetime attributes future covariates; for instance it's now possible to call
39+
`my_series.add_datetime_attribute('weekday', cyclic=True)`, which will add two columns containing a sin/cos
40+
encoding of the weekday.
41+
42+
- Default seasonality inference in `ExponentialSmoothing`. If left to `None`, the `seasonal_periods` is inferred
43+
from the `freq` of the provided series.
44+
45+
- Various documentation improvements.
46+
47+
**Fixed:**
48+
- Now transformations and forecasting maintain the columns' names of the `TimeSeries`.
49+
The generation module `darts.utils.timeseries_generation` also comes with better default columns names.
50+
- Some issues with our Docker build process
51+
- A bug with GPU usage
52+
53+
**Changed:**
54+
- For probabilistic PyTorch based models, the generation of multiple samples (and series) at prediction time is now
55+
vectorized, which improves inference performance.
856

957
## [0.9.1](https://github.com/unit8co/darts/tree/0.9.1) (2021-07-17)
1058
### For users of the library:

Dockerfile

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
FROM jupyter/base-notebook:python-3.7.6
1+
FROM jupyter/base-notebook:python-3.9.5
22

3-
# By default base-notebook install latest python version and fix it in the pinned constraint
4-
# remove the file, change the python version and update packages
5-
6-
#RUN rm $CONDA_DIR/conda-meta/pinned
7-
#RUN conda install python=3.6.8 -y --quiet && conda update --all -y --quiet && \
8-
#conda clean --all -f -y
9-
RUN conda install -c conda-forge ipywidgets -y --quiet
3+
RUN conda update --all -y --quiet \
4+
&& conda install -c conda-forge ipywidgets -y --quiet \
5+
&& conda clean --all -f -y
106

117
USER root
128

13-
RUN apt-get update && apt-get -y install curl && apt-get -y install apt-utils
14-
15-
# to build prophet
16-
RUN apt-get -y install build-essential libc-dev
9+
# to build pystan
10+
RUN apt-get update \
11+
&& apt-get -y install build-essential \
12+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1713

1814
USER $NB_USER
1915

20-
# u8ts specific deps
21-
RUN pip install pystan
2216
ADD . /home/jovyan/work
2317

2418
WORKDIR /home/jovyan/work
2519

26-
RUN pip install .['all']
20+
RUN pip install .

README.md

+34-25
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
---
66
[![PyPI version](https://badge.fury.io/py/u8darts.svg)](https://badge.fury.io/py/darts)
7-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unit8co/darts/darts%20release%20workflow/master)
7+
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/u8darts-all.svg)](https://anaconda.org/conda-forge/u8darts-all)
88
![Supported versions](https://img.shields.io/badge/python-3.7+-blue.svg)
99
![Docker Image Version (latest by date)](https://img.shields.io/docker/v/unit8/darts?label=docker&sort=date)
1010
![GitHub Release Date](https://img.shields.io/github/release-date/unit8co/darts)
11+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unit8co/darts/darts%20release%20workflow/master)
1112
[![Downloads](https://pepy.tech/badge/u8darts)](https://pepy.tech/project/u8darts)
1213
[![Downloads](https://pepy.tech/badge/darts)](https://pepy.tech/project/darts)
1314

@@ -27,6 +28,11 @@ on multiple time series, and some of the models offer probabilistic forecasts.
2728
* [Introductory Blog Post](https://medium.com/unit8-machine-learning-publication/darts-time-series-made-easy-in-python-5ac2947a8878)
2829
* [Introductory Video](https://www.youtube.com/watch?v=Sx-uI-PypmU&t=8s&ab_channel=Unit8)
2930

31+
##### Articles on Selected Topics
32+
* [Training Models on Multiple Time Series](https://medium.com/unit8-machine-learning-publication/training-forecasting-models-on-multiple-time-series-with-darts-dc4be70b1844)
33+
* [Using Past and Future Covariates](https://medium.com/unit8-machine-learning-publication/time-series-forecasting-using-past-and-future-external-data-with-darts-1f0539585993)
34+
* [Temporal Convolutional Networks and Forecasting](https://medium.com/unit8-machine-learning-publication/temporal-convolutional-networks-and-forecasting-5ce1b6e97ce4)
35+
3036
## Install
3137

3238
We recommend to first setup a clean Python environment for your project with at least Python 3.7 using your favorite tool ([conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html "conda-env"), [venv](https://docs.python.org/3/library/venv.html), [virtualenv](https://virtualenv.pypa.io/en/latest/) with or without [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/)).
@@ -35,7 +41,7 @@ Once your environment is set up you can install darts using pip:
3541

3642
pip install darts
3743

38-
For more detailed install instructions you can refer to our installation guide at the end of this page.
44+
For more detailed install instructions you can refer to our [installation guide](#installation-guide) at the end of this page.
3945

4046
## Example Usage
4147

@@ -95,8 +101,14 @@ from R2-scores to Mean Absolute Scaled Error.
95101

96102
**Backtesting:** Utilities for simulating historical forecasts, using moving time windows.
97103

98-
**Regressive Models:** Possibility to predict a time series from lagged versions of itself
99-
and of some external covariate series, using arbitrary regression models (e.g. scikit-learn models)
104+
**Regression Models:** Possibility to predict a time series from lagged versions of itself
105+
and of some external covariate series, using arbitrary regression models (e.g. scikit-learn models).
106+
107+
**Multiple series training:** All neural networks, as well as `RegressionModel`s (incl. `LinearRegressionModel` and
108+
`RandomForest`) support being trained on multiple series.
109+
110+
**Past and Future Covariates support:** Some models support past-observed and/or future-known covariate time series
111+
as inputs for producing forecasts.
100112

101113
**Multivariate Support:** Tools to create, manipulate and forecast multivariate time series.
102114

@@ -120,12 +132,12 @@ Model | Univariate | Multivariate | Probabilistic | Multiple-series training | P
120132
`Theta` and `FourTheta` | x | | | | |
121133
`Prophet` | x | | | | |
122134
`FFT` (Fast Fourier Transform) | x | | | | |
123-
Regression Models (incl `RandomForest` and `LinearRegressionModel`) | x | | | | |
124-
`RNNModel` (incl. LSTM and GRU); equivalent to DeepAR in its probabilistic version | x | x | x | x | x | x
125-
`BlockRNNModel` (incl. LSTM and GRU) | x | x | | x | x | ( x )
126-
`NBEATSModel` | x | x | | x | x | ( x )
127-
`TCNModel` | x | x | x | x | x | ( x )
128-
`TransformerModel` | x | x | | x | x | ( x )
135+
`RegressionModel` (incl `RandomForest` and `LinearRegressionModel`) | x | x | | x | x | x
136+
`RNNModel` (incl. LSTM and GRU); equivalent to DeepAR in its probabilistic version | x | x | x | x | | x
137+
`BlockRNNModel` (incl. LSTM and GRU) | x | x | | x | x |
138+
`NBEATSModel` | x | x | | x | x |
139+
`TCNModel` | x | x | x | x | x |
140+
`TransformerModel` | x | x | | x | x |
129141
Naive Baselines | x | | | | |
130142

131143
## Contribute
@@ -142,16 +154,12 @@ If what you want to tell us is not a suitable github issue, feel free to send us
142154

143155
## Installation Guide
144156

145-
### Preconditions
146-
147157
Some of the models depend on `prophet` and `torch`, which have non-Python dependencies.
148158
A Conda environment is thus recommended because it will handle all of those in one go.
149159

150-
The following steps assume running inside a conda environment.
151-
If that's not possible, first follow the official instructions to install
152-
[prophet](https://facebook.github.io/prophet/docs/installation.html#python)
153-
and [torch](https://pytorch.org/get-started/locally/), then skip to
154-
[Install darts](#install-darts)
160+
### From conda-forge
161+
Currently only Python 3.7 is fully supported with conda; consider using PyPI if you are running
162+
into troubles.
155163

156164
To create a conda environment for Python 3.7
157165
(after installing [conda](https://docs.conda.io/en/latest/miniconda.html)):
@@ -162,18 +170,18 @@ Don't forget to activate your virtual environment
162170

163171
conda activate <env-name>
164172

173+
As some models have relatively heavy dependencies, we provide two conda-forge packages:
165174

166-
#### MAC
167-
168-
conda install -c conda-forge -c pytorch pip prophet pytorch
169-
170-
#### Linux and Windows
175+
* Install darts with all available models (recommended): `conda install -c conda-forge u8darts-all`.
176+
* Install core only (without neural networks, Prophet or AutoARIMA): `conda install -c conda-forge u8darts`
171177

172-
conda install -c conda-forge -c pytorch pip prophet pytorch cpuonly
173178

174-
### Install darts
179+
### From PyPI
180+
Install darts with all available models: `pip install darts`.
175181

176-
Install Darts with all available models: `pip install darts`.
182+
If this fails on your platform, please follow the official installation guides for
183+
[prophet](https://facebook.github.io/prophet/docs/installation.html#python)
184+
and [torch](https://pytorch.org/get-started/locally/), then try installing Darts again.
177185

178186
As some models have relatively heavy (or non-Python) dependencies,
179187
we also maintain the `u8darts` package, which provides the following alternate lighter install options:
@@ -183,6 +191,7 @@ we also maintain the `u8darts` package, which provides the following alternate l
183191
* Install core + Facebook Prophet: `pip install 'u8darts[prophet]'`
184192
* Install core + AutoARIMA: `pip install 'u8darts[pmdarima]'`
185193

194+
186195
### Running the examples only, without installing:
187196

188197
If the conda setup is causing too many problems, we also provide a Docker image with everything set up for you and ready-to-use Python notebooks with demo examples.

build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ buildscript {
66
}
77

88
plugins {
9-
id "com.palantir.docker" version "0.26.0"
10-
id "com.palantir.docker-run" version "0.26.0"
9+
id "com.palantir.docker" version "0.27.0"
10+
id "com.palantir.docker-run" version "0.27.0"
1111
}
1212

1313
// needed for palantir plugin
@@ -87,7 +87,7 @@ for(String flavour : flavours) {
8787
}
8888

8989
task installLocally(type:Exec) {
90-
commandLine "pip", "install", ".[all]"
90+
commandLine "pip", "install", "."
9191
}
9292

9393
task pipInstall() {

darts/dataprocessing/dtw/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .cost_matrix import CostMatrix
2+
from .window import Window, NoWindow, Itakura, SakoeChiba, CRWindow
3+
from .dtw import dtw, DTWAlignment

0 commit comments

Comments
 (0)