Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter Notebook: Importing SMOTE from imblearn - ImportError: cannot import name 'pairwise_distances_chunked'

I'm trying to use the SMOTE package in the imblearn library using:

from imblearn.over_sampling import SMOTE

getting the following error message:

ImportError: cannot import name 'pairwise_distances_chunked'.

Here is a screenshot of my import screenshot of download confirmation

Really stumped on this, any guidance would be greatly appreciated.

like image 719
Billy Hansen Avatar asked Oct 18 '18 19:10

Billy Hansen


2 Answers

I have encountered a similar problem. I could solve by opening a new IPython console.

like image 100
00__00__00 Avatar answered Nov 16 '22 03:11

00__00__00


I know it's a bit late, but for anyone using Jupyter notebook, I could solve my problem by just restarting the kernel.

Link:

ImportError: cannot import name check_array from sklearn.utils.validation

like image 2
Sumanth Bharadwaj M Avatar answered Nov 16 '22 04:11

Sumanth Bharadwaj M