Skip to content

Update from unit8co/darts. - #11

Open
Jeadie wants to merge 413 commits into
spicehq:masterfrom
unit8co:master
Open

Update from unit8co/darts.#11
Jeadie wants to merge 413 commits into
spicehq:masterfrom
unit8co:master

Conversation

@Jeadie

@Jeadie Jeadie commented Oct 15, 2024

Copy link
Copy Markdown

Fixes #.

Summary

Other Information

dependabot Bot and others added 30 commits March 6, 2025 09:41
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.5...3.1.6)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Replace MultioutputRegressor by native multioutput from CastBoost, wip

* Add _native_support_multioutput() to regression models, wip

* Fix logic, replace RMSE with MultiRMSE when multioutput is required

* Add entry to change log

* Adapt shapexplainer test to support all native multioutput

* Let user decide on native multioutput usage

* Update CHANGELOG.md

* Update CHANGELOG.md

* Add recursive call for native multioutput

* Add test for native multioutput support

* Fix logic, only sklearn model should be passed to RegressionModel

* Set loss_function in kwargs following model default

* Fix SNM logic to be independant of MOR wrapper

* Use __sklearn_tags__ instead of _get_tags as required in sklearn 1.7

* Update CHANGELOG.md

* Minor rewriting

* Remove logic for xboost<2.0.0

* minor updates

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
…s series (#2710)

* fix: bug when several static covariates have only one category

* feat: added corresponding tests

* update changelog

* update changelog

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* feat: adding support for getting estimator based on quantile and associated tests

* updated changelog

* minor updates

* fix: combined get_multioutput_estimator and get_estimator into a single method

* fix: typo

* update changelog

* update changelog

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* notes

* dennis note

* trying a few things

* seems to fix it

* fix and tests

* note removal

* overlap_end taken into account

* pr corrections

* changelog updated

* comment adpated

* make optimized hfc work identically as non optimized

* update changelog

* update changelog

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* feat: adding tests for the optional dependencies

* fix: typos

* fix: typo

* fix: tests, extended to more models

* fix: also cover exporting to onnx after laoding ckpt

* fix: use_X_covariate attribute is correctly updated after loading weights from checkpoint

* update the test of the onnx optional dep, add a util file

* reduced code redundancy in the tests

* feat: adding tests for optuna

* feat: adding tests for ray

* fix: simplified test

* fix: github actions

* tmp fix: remove ray test for regression model

* fix: improve test coverage

* fix: further simply the tests

* address review comments

* minor update

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* fix: simplified logic after increase in minimym version for statsmodels

* fix: simplified logic after increase of minimum version for sklearn

* update changelog

* Update CHANGELOG.md

---------

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
* to_series and to_dataframe added

* removed pd_dataframe calls in the file

* error test corrected

* to_series and to_dataframe added in tests

* Update darts/timeseries.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Update darts/timeseries.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Update darts/timeseries.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* corrections

* polars test added

* changelog added

* to_series corrected because of change of default value of `time_as_index`

* minor updates

* pd_series and pd_dataframe replace by to_...

* removed default args from `.to_dataframe()` calls

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* warnings changed

* accept every backend accepted by narwhals

* .values forgotten

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* reduce diffs

* default args removed from method calls

* Dennis' suggestions

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* last corrections

* update polars test

* update backend handling

* update docs

* add polars to optional tests

---------

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
* Added metadata attribute, carried along through operations

* changelog

* refactored metadata into a pandas Series

* fix lags_past_covariates dict type breaks lags_future_covariates when output_chunk_shift>0 (#2655)

* if clause modified to correct bug

* contribution added to changelog

* implemented modifications from reviewer

* unit tests added

---------

Co-authored-by: “authierj” <“jules.authier@unit8.co”>

* fix failing tfm load with pytorch>=2.6.0 (#2658)

* Allow to strip training data for storage and memory reason on save for GlobalForecastingModel (#2649)

* Add option to drop training_series during save() for GlobalForecastingModel

* Update error on predict with no training series, update tests

* Update CHANGELOG.md

* Add _clean fonction to get a cleaned instance of the models

* Use shallow copy to get clean model

* Update darts/models/forecasting/regression_model.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Update darts/models/forecasting/torch_forecasting_model.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Define _clean() in ForecastingModel

* Fix typo in docstring

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Reformulate comment

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Update CHANGELOG.md

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Add clean argument in model.save for conformal and ensemble models

* Update docstring

* Remove additional training params on clean, update tests

* Fix _clean and save logic, update save/load test

* Update darts/models/forecasting/forecasting_model.py

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* Remove map_location on model load, set cpu as default accelerator

* Update CHANGELOG.md

* Add covariate to save/load test

* Update CHANGELOG.md

* Add _clean() to clean sub-model, update unit tests

* Add _clean() to clean sub-models, update unit tests

* minor refactor

* further upadtes

* pickle tfm model wrapper instead of torch save / load

* update changelog

* last fix

---------

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>

* adapted tests for metadata

* changelog

* add missing metadat propagation and fix tests

* metadata changed to dict

* tests adapted, one removed for metadata

* remove metadata from timeseries generation

* update timeseries

* extend unit tests

* update changelog

* udpate changelog

---------

Co-authored-by: Jules Authier <55801833+authierj@users.noreply.github.com>
Co-authored-by: “authierj” <“jules.authier@unit8.co”>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Jonas Blanc <44334351+jonasblanc@users.noreply.github.com>
Co-authored-by: authierj <jules.authier@unit8.co>
* fix nlinear norm

* update changelog
* update quickstart, readme and timeseries docs

* update changelog
* bump u8darts 0.33.0 to 0.34.0

* update changelog
* remove TimeSeries.pd_*()

* update changelog
* remove AutoARIMA model in favor of sf AutoARIMA

* update changelog

* update changelog

* fix test
* make base likelihood model

* move likelihoods to dedicated module

* refactor regression model likelihoods

* fix failing tests

* remove remaining old likelihood references

* rename likelihood.likelihood_models to likelihood_models.torch

* update changelog

* fix imports

* address some missed lines

* make torch likelihoods backwards compatible

* add sklearn likelihood tests

* remane likelihood.py to base.py

* apply suggestions from PR review

* update gaussian sklearn likelihood

* rename torch base likelihood

* update docs
* fix torch likelihood imports for missing torch dependency

* move NotImportedModule to utils/utils.py
* Add categorical cov support to XGBoost, CatBoost

* Add type check for cat features, refactor cat indices logic

* Split cat. comp. validation logic and test it

* Support categorical cov created via an encoder

* Validate categorical features

* Support categorical features for HistGradientBoostingRegressor

* Fix typos

* Apply suggestions, limit cat cov  support to LightGBM and CatBoost

* Update changelog and doc

* Fix test categorical features

* minor refactoring

* further refactoring

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* doc add missing activation function

* doc shorten activation function text (now similar to nbeats, nhits)

* fix typo

* lint

---------

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
* Implementation of StatsForecastAutoMFLES

* Added StatsForecastAutoMFLES entry to CHANGELOG

* Added StatsForecastAutoMFLES entry to README

* Added StatsForecastAutoMFLES entry to covariates

* minor updates

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* rename StatsForecast* models

* update changelog

* update examples
* Format validation set

* Add cat_feature to validation set

* Test categorical validation set

* Update darts/tests/models/forecasting/test_regression_models.py

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>

---------

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>
* add gaussian likelihood

* refactor f models

* general statsforecast model

* update statsforecastmodel

* add transferable series support

* update docs

* simplify  model_args and kwargs names

* fix hist fc test with new autoarima

* add tests

* apply suggestions from PR review

* add tests

* update docs

* final adaptions

* docs upadte

* update examples in docs

* update changelog
* change tbats backend from tbats to statsforecast

* fix failing tests

* update changelog

* update changelog

* fix failing test

* update docs
* relexnumpy v2 upper cap

* remove bats and tbats

* run macos only

* run on macos-14 (silicon)

* run develop workflow on macos-14 (silicon)

* test

* run all macos tests

* run failing tests

* change cp test

* further adapt tests

* another failing test

* fix last test

* fix elec zurich ds for arm processors

* check dataset loading

* complete macos tests

* fix last failing macos tests

* another test fix for macos

* run failing ubuntu tests

* check explicit failing tests

* try setting locale sorting

* try fix sorting

* run all tabularization tests

* update workflows

* remove macos uv install step

* try removing libomp installation step since new macos-14 build

* remove unused limbomp istall scripts

* update changelog
* add back libomp for python 3.11 checks

* lightweight 3.11 tests

* simplify command

* make libomp script executable

* fix type

* fix typo

* add libomp installation to all workflows
* bump u8darts 0.34.0 to 0.35.0

* update changelog

* update changelog

* update readme

* update docs
dennisbader and others added 30 commits June 27, 2026 13:29
* add teacher forcing to transformer model

* change encoder to the original implementation (the best metrics) and use d_model as normalization factor

* add 0 padding to targets, to compensate for missing past covariates

* add comments

* switch to .device instead of get_device()

* fix after merge

* small refactor

* refactor + update docstrings

* update docstring

* fix missing docstring info + add layer norm as default

* fix a typo in docstring

* remove Transformer torch import, add past covariate to decoder starting token

* working training

* bugfix

* optimization

* improves performance on sunspots by half

* fix probabilistic test

* update notebook

* refactor to unify torch module inputs

* fix tests

* clean up transformer code

* update notebook

* update changelog

---------

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>
Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* Add citation cff

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

* Split family and given names

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

* Add changelog entry

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

* update names

* udpate readme and paper url

* correct article reference

* update readme

* use string quotes always

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* Move tft_submodels into components

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

* Add changelog entry

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* fix treat_na issues in window transformer

* update changelog
* add global_forecasting_model_wrapper.py

* add tests

* add comments

* Switch to being a multivariate model wrapper instead of a global model wrapper

* refactor

* add missing property decorator

* update tests

* Improve testing code for MultivariateForecastingModelWrapper

* Expand description

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>

* Refactor fit loop to make it more intuitive

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>

* delete function and rewrite docstring

* fix future_covariates error

* parametrize test

* lint

* add to __all__ init.py

* update import

* parametrize encoder support

* update typing

* update tests

* fix tests

* rename, delete unneded and update local model passing in constructor

* rename model to _model, handle kwargs

* add local forecasting model property exposure

* additional properties, modify only private methods

* use model

* import + test rename

* fix property and kwargs syntax

* predict using univariate components

* fix future covariates handling

* fix raise_log

* further updates for PR finalization

* update docs

* improve coverage

* update docs title

---------

Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>
Co-authored-by: Felix Divo <felix.divo@cs.tu-darmstadt.de>
Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* Add `scale_batch_size()` to `TorchForecastingModel`

- A wrapped around Lightning Tuner's method of the same name,
  `scale_batch_size()` finds a batch size before out-of-memory error.
- Options for Tuner method are supported, including `mode`,
  `steps_per_trial`, `init_val`, and `max_trials`.
- Tuner requires a `batch_size` attribute within `LightningDataModule`
  or model and disallows previous `train_loader` and `val_loader`.
- Because of that, I implemented `_CustomDataModule` and
  `_CustomDataModuleWithVal` to return dataloaders as per `batch_size`.
- The previous behaviours of `dataloader_kwargs` are being preserved
  with the new datamodules.
- Update `_setup_for_train()`, `_train()`, `fit_from_dataset()`,
  `lr_find()` methods to use datamodules instead of direct data loaders.

* Add a `scale_batch_size()` test and update dataloader-related tests

- Add `test_scale_batch_size` for validating `scale_batch_size()`
  method.
- Update `test_dataloader_kwargs_setup` to validate `datamodule`
  instead of `train_dataloaders` and `val_dataloaders` due to changes.
- Update `helper_check_val_set` used in `test_val_set` to again validate
  `datamodule`.

* Update CHANGELOG & `scale_batch_size` docstring

* Fix a bug in `_setup_for_train` when `val_dataset` is `None`

- When `val_dataset` is `None`, `_CustomDataModule` would still need to
  implement `val_dataloader()` for Lightning to work.
- Since `val_dataloader()` can return ANY iterable but not `None` as per
  Lightning `EVAL_DATALOADERS`, we return an empty list here.
- Batch size scaling would not update the model weights, so there is no
  need to re-initialize the model after scaling.

* Add tests to validate unchanged model weights after training

As per previous commit, batch size scaling would not update model
weights. The model can be used for training directly.

- Update `test_scale_batch_size()` to NOT re-initialize the model after
  scaling.
- Add `test_scale_batch_size_no_updates()` to validate that the model
  weights do not change after scaling.

* Fix on `load_best` when merging commits

Co-authored-by: Zhihao Dai <zhihao.dai@eng.ox.ac.uk>

* add predict dataloader to DataModule

* add update_model parameter to control updating the models batch size

* fix failing determinism tests

* make torch data module private

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* add variable input length support to foundation models and darts torch datasets

* simplify memeory indexer

* simplify datasets

* test utils for foundation models

* add tiny TimesFM2p5 model

* remove unsed method

* make icl variable length

* update changelog

* add additional tests

* allow loading model with variable icl

* update changelog

* update notebook

* fix patchtst pad handling

* update notebook
* relax lightning upper cap

* fix weights_only loading for lightning >= 2.6.0

* fix checkpoint loading for lr_find and scale_batch_size

* fix lr_find test

* make checkpoint IO handle lightning version

* update changelog

* simplify API
* fix append and prepend methods dtype conversion

* fix with_values methods dtype conversion

* further fixes

* fix dtype conversion for data transformers

* update changelog

* fix forecasting model dtype convservation

* move helper to utils

* remove dtype from schema and avoid casting torch model outputs

* fix boxcox test

* improve coverage
* allow start='end' in historical forecasts

* cleanup

* better tests

* move extend series to backtest

* speed up start end time extraction

* update changelog

* use start and end time where applicable

* improve coverage

* improve coverage
* remove PyOD and Shap from core dependencies

* update docs and notebookds

* update changelog

* move shap and pyod back into core
* Add optional minimum_length to local models to override default min training length

Fixes #3001. StatsForecast models (and other local models whose exact minimum
darts cannot infer) hardcoded a conservative minimum training series length of
10, which prevented fitting on shorter series that the underlying statsforecast
models handle fine.

- ForecastingModel: accept and validate an optional minimum_length; add helper
  _min_train_input_length() applied inside _target_window_lengths
- Expose minimum_length on local models only (LocalForecastingModel, the whole
  StatsForecast family, ExponentialSmoothing); global models are unchanged
- Add tests reproducing #3001 and covering default/override/validation
- CHANGELOG entry

* CHANGELOG: reference PR #3167

* Address review: rename to min_train_length, uniform docstring, extend to remaining local models

- Rename `minimum_length` to `min_train_length`
- Apply suggested validation, comment, and uniform docstring across all models
- Extend the parameter to ARIMA, VARIMA, Theta, FourTheta, Prophet, FFT and KalmanForecaster
- Add parametrized test for the newly wired models; update repr expectations

---------

Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* Add per-timestep encoder/decoder variable importance to TFTExplainer

TFTExplainer.explain() only exposed variable importances aggregated
over the whole input chunk / forecast horizon. Add a sibling helper
that skips the time-averaging step and expose the result per series
as a `TimeSeries` (one component per variable), so importance can be
tracked at each individual encoder/decoder timestep.

Addresses #2685.

* Expose per-timestep TFT importances via TFTExplainabilityResult

Add get_encoder_importance_over_time() / get_decoder_importance_over_time()
accessors, following the same get_explanation()-backed pattern as the
existing get_attention()/get_encoder_importance() methods.

* Add tests for per-timestep TFT variable importance

Extend the existing parametrized explainer tests with shape/timing/
sum-to-100% checks for the new over-time importances across all
covariate/encoder/relative-index combinations, and cross-check in
test_variable_selection_explanation that averaging the per-timestep
values over time recovers the already-validated aggregated importance.

* Add changelog entry for TFT per-timestep importance

PR number is a placeholder (#XXXX) until the PR against unit8co/darts
is actually opened.

* Update changelog PR link with actual PR number (#3170)

* minor updates

* relax test equality

---------

Co-authored-by: exactml <--global>
Co-authored-by: dennisbader <dennis.bader@gmx.ch>
* update test for statsforecast v2.1.1 support

* bump jupyterlab from 4.5.9 to 4.6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.