Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name '_deprecate_positional_args' from 'sklearn.utils.validation'

when I try to import deprecate_positional_args fuction from sklearn.utils.validation' I got this import error:

ImportError: cannot import name '_deprecate_positional_args' from 'sklearn.utils.validation'

The scikit-learn version is 0.21.3

like image 569
sahar allégue Avatar asked Jun 29 '20 15:06

sahar allégue


2 Answers

I was facing the same error when running in a Jupyter environment. Was resolved by installing imbalanced-learn by running !pip install -U imbalanced-learn and then restarting the runtime. Restarting the runtime is the key here. If you don't restart, the error won't go.

like image 152
Samkit Jain Avatar answered Sep 19 '22 14:09

Samkit Jain


I solved this problem by upgrading scikit-learn:

pip install --upgrade scikit-learn
like image 43
Hao Sun Avatar answered Sep 20 '22 14:09

Hao Sun