歸一化:對原始數據進行線性變換把數據映射到[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)