0

I want to use SMOTE to resampling my dataset. When I'm on Google Colab and I tried to import the package using:

from imblearn.over_sampling import SMOTE

I get the error:

ImportError: cannot import name '_check_X' from 'imblearn.utils._validation' (/usr/local/lib/python3.10/dist-packages/imblearn/utils/_validation.py)

What can I do to fix this error? Thanks

  • Hi, I tried it just right now on a fresh Google Colab notebook and the import natively works for me. I think you should precise your question. Also, please test on a fresh notebook if you didn't yet – Bichon Jul 13 '23 at 15:46
  • @Bichon: I tried it with new notebook and it works. But when I add other codes (example: from sklearn.naive_bayes import GaussianNB), some other codes don't work. After that, when I delete code "from imblearn.over_sampling import SMOTE" and restart runtime, all other codes work. I don't understand :( – Hong Nguyen Thi Jul 14 '23 at 10:35

0 Answers0