-1

My code is as follows:

from imblearn import over_sampling

I get this error:

cannot import name 'DistanceMetric' from 'sklearn.metrics'

A simple import on imblearn is giving the same error. I tried reinstalling scikit learn and scipy, but I still get the same error.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
ella
  • 89
  • 1
  • 7

1 Answers1

2

Since it is working fine on my computer, it must be your installation. Try uninstalling scikit-learn before reinstalling.

Edit: If that is not working I would try running: python -m pip show scikit-learn

uninstall sklearn, delete the directory for sklearn, reboot the computer, and reinstall sklearn.

Kilian
  • 468
  • 2
  • 9