Skip to content

Commit db1e747

Browse files
authored
Merge branch 'master' into master
2 parents 013b7e3 + 98b3455 commit db1e747

32 files changed

Lines changed: 5575 additions & 1140 deletions

.dockerignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.github
2-
static
3-
scripts
4-
docs
5-
conda_recipe
6-
LICENSE
1+
**/.DS_Store
2+
**/.ipynb_checkpoints
3+
**/__pycache__
4+
5+
# Test files
6+
darts/tests/
7+
darts/examples/static
8+
**/darts_logs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docs/source/README.rst
99
docs/source/release_notes/
1010
docs/source/generated_api
1111
darts.egg-info/
12+
u8darts.egg-info/
1213
build/
1314
dist/
1415
examples/.ipynb_checkpoints/

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,28 @@ but cannot always guarantee backwards compatibility. Changes that may **break co
1111

1212
**Improved**
1313

14+
- Added support for classification forecasting with SKLearn-like forecasting models. [#2765](https://github.com/unit8co/darts/pull/2765) by [Jonas Blanc](https://github.com/jonasblanc) and [Dennis Bader](https://github.com/dennisbader).
15+
- Added `SklearnClassifierModel` which can take any sklearn-like classifier model.
16+
- Added `LightGBMClassifierModel`, `XGBClassifierModel` and `CatBoostClassifierModel` which use the classifier models of the respective libraries.
17+
- Added `ClassProbabilityLikelihood` and set it as the default likelihood for classifiers to predict class probabilities with `predict_likelihood_parameters=True` when calling `predict()`.
18+
- Added classification metrics `accuracy()`, `f1()`, `precision()`, and `recall()`, `confusion_matrix()` to the `metrics` module. Use these metrics to evaluate the performance of classification models. [#2767](https://github.com/unit8co/darts/pull/2767) by [Jonas Blanc](https://github.com/jonasblanc) and [Dennis Bader](https://github.com/dennisbader).
19+
1420
**Fixed**
1521

22+
- Fixed a bug in `SKLearnModel.get_estimator()` for univariate quantile models that use `multi_models=False` , where using `quantile` did not return the correct fitted quantile model / estimator. [#2838](https://github.com/unit8co/darts/pull/2838) by [Dennis Bader](https://github.com/dennisbader).
23+
- Fixed a bug in `LightGBMModel` and `CatBoostModel` when using component-specific lags and categorical features, where certain lag scenarios could result in incorrect categorical feature declaration. [#2852](https://github.com/unit8co/darts/pull/2852) by [Dennis Bader](https://github.com/dennisbader).
24+
- Removed `darts/tests` and `examples` from the Darts package distribution. These are only required for internal testing. [#2854](https://github.com/unit8co/darts/pull/2854) by [Dennis Bader](https://github.com/dennisbader).
25+
1626
**Dependencies**
1727

28+
- Removed the upper version cap on `scipy<1.16.0` since `statsmodels` added support in version `0.14.5`. [#2853](https://github.com/unit8co/darts/pull/2853) by [Dennis Bader](https://github.com/dennisbader).
29+
1830
### For developers of the library:
1931

32+
- Renamed `RegressionModelWithCategoricalCovariates` to `RegressionModelWithCategoricalFeatures` which now also supports categorical target features. [#2765](https://github.com/unit8co/darts/pull/2765) by [Jonas Blanc](https://github.com/jonasblanc)
33+
- Added `MultiOutputClassifier` for handling multi-output classification tasks. [#2765](https://github.com/unit8co/darts/pull/2765) by [Jonas Blanc](https://github.com/jonasblanc)
34+
- Cleaned up `Dockerfile` to only include the necessary files for building the Darts package. [#2854](https://github.com/unit8co/darts/pull/2854) by [Dennis Bader](https://github.com/dennisbader).
35+
2036
## [0.36.0](https://github.com/unit8co/darts/tree/0.36.0) (2025-06-29)
2137

2238
### For users of the library:

Dockerfile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
# Use a specific Python version for better reproducibility
12
FROM python:3.10
23

3-
# install python requirements before copying the rest of the files
4-
# this way we can cache the requirements and not have to reinstall them
4+
# Set work directory
5+
WORKDIR /app
6+
7+
# Copy requirements first for better layer caching
58
COPY requirements/ /app/requirements/
6-
RUN pip install -r /app/requirements/dev-all.txt
79

8-
# copy local files
9-
COPY . /app
10+
# Install Python dependencies
11+
RUN pip install --no-cache-dir -r /app/requirements/dev-all.txt
1012

11-
# set work directory
12-
WORKDIR /app
13+
# Copy only the files explicitly needed for installation
14+
COPY setup.py pyproject.toml MANIFEST.in README.md /app/
15+
COPY darts/ /app/darts/
16+
17+
# Install darts in development mode
18+
RUN pip install --no-cache-dir -e . && \
19+
# Clean up pip cache
20+
rm -rf ~/.cache/pip
1321

14-
# install darts
15-
RUN pip install -e .
22+
# Copy examples
23+
COPY examples/ /app/examples/
1624

1725
# assuming you are working from inside your darts directory:
1826
# docker build . -t darts-test:latest

darts/ad/scorers/kmeans_scorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from darts import metrics
1616
from darts.ad.scorers.scorers import WindowedAnomalyScorer
1717
from darts.logging import get_logger
18-
from darts.metrics.metrics import METRIC_TYPE
18+
from darts.metrics.utils import METRIC_TYPE
1919

2020
logger = get_logger(__name__)
2121

darts/ad/scorers/pyod_scorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from darts import metrics
1313
from darts.ad.scorers.scorers import WindowedAnomalyScorer
1414
from darts.logging import get_logger, raise_if_not
15-
from darts.metrics.metrics import METRIC_TYPE
15+
from darts.metrics.utils import METRIC_TYPE
1616

1717
logger = get_logger(__name__)
1818

darts/ad/scorers/scorers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
show_anomalies_from_scores,
3333
)
3434
from darts.logging import get_logger, raise_log
35-
from darts.metrics.metrics import METRIC_TYPE
35+
from darts.metrics.utils import METRIC_TYPE
3636
from darts.utils.data.tabularization import create_lagged_data
3737
from darts.utils.ts_utils import series2seq
3838
from darts.utils.utils import _build_tqdm_iterator, _parallel_apply

darts/ad/scorers/wasserstein_scorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from darts import TimeSeries, metrics
2020
from darts.ad.scorers.scorers import WindowedAnomalyScorer
2121
from darts.logging import get_logger
22-
from darts.metrics.metrics import METRIC_TYPE
22+
from darts.metrics.utils import METRIC_TYPE
2323

2424
logger = get_logger(__name__)
2525

darts/metrics/__init__.py

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""
22
Metrics
3-
-------
3+
=======
4+
5+
Regression Metrics
6+
------------------
47
58
For deterministic forecasts (point predictions with `num_samples == 1`), probabilistic forecasts (`num_samples > 1`),
69
and quantile forecasts. For probabilistic and quantile forecasts, use parameter `q` to define the quantile(s) to
@@ -65,19 +68,42 @@
6568
- :func:`IC <darts.metrics.metrics.ic>`: Interval Coverage
6669
- :func:`INCS_QR <darts.metrics.metrics.incs_qr>`: Interval Non-Conformity Score for Quantile Regression
6770
71+
Classification Metrics
72+
----------------------
73+
74+
For deterministic forecasts (point predictions with `num_samples == 1`), probabilistic forecasts (`num_samples > 1`),
75+
and class label probability forecasts. Most metrics allow to extract the scores for specific labels with parameter
76+
`labels`.
77+
78+
- Aggregated over time:
79+
- :func:`Accuracy <darts.metrics.metrics.accuracy>`: Accuracy Score
80+
- :func:`Precision <darts.metrics.metrics.precision>`: Precision Score
81+
- :func:`Recall <darts.metrics.metrics.recall>`: Recall Score
82+
- :func:`F1 <darts.metrics.metrics.f1>`: F1 Score
83+
- :func:`CM <darts.metrics.metrics.confusion_matrix>`: Confusion Matrix
84+
85+
Dynamic Time Warping Metrics
86+
----------------------------
87+
6888
For Dynamic Time Warping (DTW) (aggregated over time):
6989
7090
- :func:`DTW <darts.metrics.metrics.dtw_metric>`: Dynamic Time Warping Metric
91+
92+
93+
7194
"""
7295

7396
from darts.metrics.metrics import (
97+
accuracy,
7498
ae,
7599
ape,
76100
arre,
77101
ase,
78102
coefficient_of_variation,
103+
confusion_matrix,
79104
dtw_metric,
80105
err,
106+
f1,
81107
ic,
82108
incs_qr,
83109
iw,
@@ -95,9 +121,11 @@
95121
mse,
96122
msse,
97123
ope,
124+
precision,
98125
ql,
99126
qr,
100127
r2_score,
128+
recall,
101129
rmse,
102130
rmsle,
103131
rmsse,
@@ -109,45 +137,6 @@
109137
wmape,
110138
)
111139

112-
ALL_METRICS = {
113-
ae,
114-
ape,
115-
arre,
116-
ase,
117-
coefficient_of_variation,
118-
dtw_metric,
119-
err,
120-
iw,
121-
iws,
122-
mae,
123-
mape,
124-
wmape,
125-
marre,
126-
mase,
127-
merr,
128-
miw,
129-
miws,
130-
mql,
131-
mse,
132-
msse,
133-
ope,
134-
ql,
135-
qr,
136-
r2_score,
137-
rmse,
138-
rmsle,
139-
rmsse,
140-
sape,
141-
se,
142-
sle,
143-
smape,
144-
sse,
145-
ic,
146-
mic,
147-
incs_qr,
148-
mincs_qr,
149-
}
150-
151140
TIME_DEPENDENT_METRICS = {
152141
ae,
153142
ape,
@@ -165,18 +154,14 @@
165154
incs_qr,
166155
}
167156

168-
Q_INTERVAL_METRICS = {
169-
iw,
170-
iws,
171-
miw,
172-
miws,
173-
ic,
174-
mic,
175-
incs_qr,
157+
CLASSIFICATION_METRICS = {
158+
accuracy,
159+
precision,
160+
recall,
161+
f1,
162+
confusion_matrix,
176163
}
177164

178-
NON_Q_METRICS = {dtw_metric}
179-
180165
__all__ = [
181166
"ae",
182167
"ape",
@@ -214,4 +199,9 @@
214199
"mic",
215200
"incs_qr",
216201
"mincs_qr",
202+
"accuracy",
203+
"precision",
204+
"recall",
205+
"f1",
206+
"confusion_matrix",
217207
]

0 commit comments

Comments
 (0)