unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
7.91k stars 857 forks source link

[BUG] Breaking changes from scikit-learn 1.4.0 #2180

Closed k-papadakis closed 7 months ago

k-papadakis commented 7 months ago

Describe the bug The private function sklearn.utils.validation._check_fit_params has been removed in scikit-learn version 1.4.0. Installing darts with pip or conda automatically installs scikit-learn 1.4.0 and tries to import the removed function in places like darts.utils.multioutput, making the installation broken (e.g. can't import NBEATS).

To Reproduce Install full darts with conda, using python=3.10, then try from darts.models import NBEATSModel

Expected behavior ImportError: cannot import name '_check_fit_params' from 'sklearn.utils.validation'

System (please complete the following information):

Escalion commented 7 months ago

I confirm this issue. Manually downgrading scikit-learn to 1.3.2 with conda install scikit-learn==1.3.2 resolves the issue as a temporary fix.

dennisbader commented 7 months ago

Hi all and thanks for raising this issue.

We have already fixed this and released darts version 0.27.2 a few hours ago (both pypi and conda packages).

Could you try installing it again?

rehanguha commented 7 months ago

Hi @dennisbader Is the new release part of a nightly something similar? Or any release template and release cycle?
Having a release template will all the PR's merged for the release will help to navigate the latest changes for the release.

I guess a pip resolver error should have occurred testing in the GitHub Action release build? What are your thoughts?

dennisbader commented 7 months ago

It's not part of a nightly or release cycle, just a patch release.

We did catch this already a couple of days ago through our PR/merge workflows. We decided to do a patch release, since also pandas and pytorch-lightning introduced some breaking changes in their newest versions.

You can track the changes in our CHANGELOG.md, however these dependency compatibility fixes (non-user facing) are not listet there.

rehanguha commented 7 months ago

It's not part of a nightly or release cycle, just a patch release.

We did catch this already a couple of days ago through our PR/merge workflows. We decided to do a patch release, since also pandas and pytorch-lightning introduced some breaking changes in their newest versions.

You can track the changes in our CHANGELOG.md, however these dependency compatibility fixes (non-user facing) are not listet there.

Makes sense. I would love to suggest to include all the PRs merged for the current release. I guess I will help all to tract all the changes. But thanks a lot. :+1:

connesy commented 7 months ago

@dennisbader I can confirm that installing darts==0.27.2 and scikit-learn==1.4.0 I am able to run from darts.utils import multioutput and from darts.models import NBEATSModel without issues.