2

I'm trying to balanced my data on jupyter-notebook, using SMOTE:

from imblearn import over_sampling
from imblearn.over_sampling import SMOTE
balanced = SMOTE()
x_balanced , y_balanced = balanced.fit_resample(X_train,y_train)

but I'm getting the following error on the first line -

AttributeError: module 'sklearn.metrics._dist_metrics' has no attribute 'DatasetsPair'

Why am I getting this error? thanks.

omerk
  • 23
  • 1
  • 4

3 Answers3

5

Reinstall scikit learn to version 1.1.0. That should solve the problem

drag88
  • 80
  • 1
  • 1
  • 6
0

Had the same error while importing modules from skforecast package

from skforecast.model_selection import grid_search_forecaster
from skforecast.model_selection import backtesting_forecaster

Reinstalling scikit-learn to version 1.1.0 or 1.0.0 worked with additionally restarting the jupyter server.

biban
  • 1
  • 2
-1

update sklearn

conda install -c anaconda scikit-learn
Itération 122442
  • 2,644
  • 2
  • 27
  • 73