ImportError: No module named sklearn.preprocessing

雨燕双飞 提交于 2019-12-05 05:51:07

The instructions given in that tutorial you linked to are obsolete for Ubuntu 14.04.

The Ubuntu 14.04 package is named python-sklearn (formerly python-scikits-learn):

sudo apt-get install python-sklearn  

The python-sklearn package is in the default repositories in Ubuntu 14.04 as well as in other currently supported Ubuntu releases.

I resolve this issue by running this command:

   sudo apt-get install python-sklearn  

normalize is a method of Preprocessing. Therefore you need to import preprocessing.

In your code you can then call the method preprocessing.normalize().

from sklearn import preprocessing
preprocessing.normailze(x,y,z)

If you are looking to make the code short hand then you could use the import x from y as z syntax

from sklearn import preprocessing as prep
prep.normalize(x,y,z) 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!