Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "ModuleNotFoundError: No module named 'sklearn.impute'" despite having latest sklearn installed (0.19.1)

I am doing a Kaggle competition which requires imputing some missing data. I have installed latest Anaconda(4.5.4) with all relevant dependencies (i.e scikit-learn (0.19.1)).

When I try to import the modules I am getting the following error:

ModuleNotFoundError: No module named 'sklearn.impute'

I have tried to import different sklearn modules without any problems. It seems that only sklearn.impute is missing.

like image 631
Milos Avatar asked Jun 13 '18 18:06

Milos


2 Answers

As BallpointBen pointed out, sklearn.impute is not yet released in the latest stable release (0.19.1). Currently it's supported only in 0.20.dev0.

like image 128
Milos Avatar answered Oct 20 '22 09:10

Milos


Try this -

from sklearn.preprocessing import Imputer

Works on both python3.5 and python3.6

(In or Out of jupyter notebook)

like image 40
Shanmukh Sain Avatar answered Oct 20 '22 07:10

Shanmukh Sain