归一化和标准化的差别在哪里? sklearn api

归一化:对原始数据进行线性变换把数据映射到[0,1]之间

  

标准化:均值为0,标准差为1

 

 

One disadvantage of normalization over standardization is that it loses some information in the data, especially about outliers.

归一化的缺点是,它会丢失一些信息,特别对于那些异常的点

 

这个作者推荐使用standardization标准化,如果你无法判断。 而且他认为你应该对其他的feature也都使用标准化。

我还真的无法判断。

 

另,---------------

在coursera教程第二节里,

theta和b之间的数量级差了快100倍,

b可以看成是一列值为1的feature,

而另外两列 feature都在80左右上下浮动,

所以这里差了80多倍,给训练带来了极大的麻烦

 

极大的

 

sklearn preprocessing 

from  sklearn import preprocessing  
scaler=preprocessing.StandardScaler().fit(X)  
X=scaler.transform(X)  
xNew=scaler.transform(xNew) 

  

posted @ 2017-07-25 22:31  烧鸭饭真好吃  阅读(3624)  评论(0编辑  收藏  举报