Skip to content

FutureWarning and UserWarning with scikit-learn>=1.2.1 #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sgummuluru opened this issue Mar 24, 2023 · 2 comments · Fixed by #999
Closed

FutureWarning and UserWarning with scikit-learn>=1.2.1 #978

sgummuluru opened this issue Mar 24, 2023 · 2 comments · Fixed by #999

Comments

@sgummuluru
Copy link

Using imbalanced-learn==0.10.1 and scikit-learn==1.2.1 or scikit-learn==1.2.2

from imblearn.ensemble import BalancedRandomForestClassifier
clf = BalancedRandomForestClassifier()
clf.fit(X, y)

raises a series of
FutureWarning: Function delayed is deprecated; The function delayed has been moved from sklearn.utils.fixes to sklearn.utils.parallel. This import path will be removed in 1.5.
UserWarning: sklearn.utils.parallel.delayed should be used with sklearn.utils.parallel.Parallel to make it possible to propagate the scikit-learn configuration of the current thread to the joblib workers.

This is potentially stemming from
utils.fixes.delayed is deprecated in 1.2.1 and will be removed in 1.5. Instead, import utils.parallel.delayed and use it in conjunction with the newly introduced utils.parallel.Parallel to ensure proper propagation of the scikit-learn configuration to the workers.
as per https://scikit-learn.org/stable/whats_new/v1.2.html#version-1-2-1

@glemaitre
Copy link
Member

Yep, we need to update the import.

@glemaitre
Copy link
Member

Thanks @sgummuluru for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants