wuub / SublimeREPL

SublimeREPL - run an interpreter inside ST2 (Clojure, CoffeeScript, F#, Groovy, Haskell, Lua, MozRepl, NodeJS, Python, R, Ruby, Scala, shell or configure one yourself)
https://github.com/wuub/SublimeREPL
Other
2.14k stars 312 forks source link

cannot import name '_ParamsValidationMixin' from 'imblearn.base' #600

Open beejay4l opened 1 year ago

beejay4l commented 1 year ago

I've re-installed the latest scikit-learn and imbalanced-learn. I've also checked all other libraries to make sure they are compatible with imbalanced-learn. But I keep getting the error below when I try to import imblearn. Can somebody tell me why it's not working, please?

Code:

import imblearn from imblearn.over_sampling import SMOTE

Error Message:


ImportError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_15900/793248694.py in ----> 1 from imblearn.over_sampling import SMOTE

~\anaconda3\lib\site-packages\imblearn__init__.py in 35 import types 36 ---> 37 from . import combine 38 from . import ensemble 39 from . import exceptions

~\anaconda3\lib\site-packages\imblearn\combine__init__.py in 3 """ 4 ----> 5 from ._smote_enn import SMOTEENN 6 from ._smote_tomek import SMOTETomek 7

~\anaconda3\lib\site-packages\imblearn\combine_smote_enn.py in 9 10 from ..base import BaseSampler ---> 11 from ..over_sampling import SMOTE 12 from ..over_sampling.base import BaseOverSampler 13 from ..under_sampling import EditedNearestNeighbours

~\anaconda3\lib\site-packages\imblearn\over_sampling__init__.py in 6 from ._adasyn import ADASYN 7 from ._random_over_sampler import RandomOverSampler ----> 8 from ._smote import SMOTE 9 from ._smote import BorderlineSMOTE 10 from ._smote import KMeansSMOTE

~\anaconda3\lib\site-packages\imblearn\over_sampling_smote__init.py in ----> 1 from .base import SMOTE, SMOTEN, SMOTENC 2 from .cluster import KMeansSMOTE 3 from .filter import SVMSMOTE, BorderlineSMOTE 4 5 all__ = [

~\anaconda3\lib\site-packages\imblearn\over_sampling_smote\base.py in 21 ) 22 ---> 23 from ...metrics.pairwise import ValueDifferenceMetric 24 from ...utils import Substitution, check_neighbors_object, check_target_type 25 from ...utils._docstring import _n_jobs_docstring, _random_state_docstring

~\anaconda3\lib\site-packages\imblearn\metrics\pairwise.py in 13 from sklearn.utils.validation import check_is_fitted 14 ---> 15 from ..base import _ParamsValidationMixin 16 from ..utils._param_validation import StrOptions 17

ImportError: cannot import name '_ParamsValidationMixin' from 'imblearn.base' (C:\Users\23480\anaconda3\lib\site-packages\imblearn\base.py)

beejay4l commented 1 year ago

Hello Everyone,

I sincerely need your support to unravel the root cause of this error message. It is delaying my assessment work. Or if anyone can suggest any other method one can use to balance imbalance classes.

I will be awaiting your feedback.

Thank you all.

beejay4l commented 1 year ago

Hi Everyone,

After uninstalling and re-installing Anaconda, my issue got resolved. I'm so happy right now.