Skip to content
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

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

Open
beejay4l opened this issue Apr 25, 2023 · 2 comments
Open

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

beejay4l opened this issue Apr 25, 2023 · 2 comments

Comments

@beejay4l
Copy link

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
Copy link
Author

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
Copy link
Author

Hi Everyone,

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

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

No branches or pull requests

1 participant