2017/3/10 week2
多變量的線性迴歸
cost function
Gradient descent: 同步變化!
其中
其中
Feature scaling : make sure features are on a similar sacle
其實就是normalization!將特徵值normalize到統一的範圍,消除特徵的值太大或太小帶來的影響,可以把範圍統一在[0,1] or [-1,1]。NG在課程裏面提到的他一般的選取range是超過[-3,3]會縮小,小於[-1/3,1/3]的會捨棄。
Mean Normalization
Normal Equation
solve
有m個observation,n個features,其中
不適用於特徵特別多(n特別大)的情況 >10000
pinv 和inv在matlab中是求矩陣的逆,但是pinv適用於
1. redundant feature(linear dependent) 特徵之間有線性關係 —>刪特徵
2. too many features (m<=n) 特徵比樣本多 —-> 刪特徵 或者 regularization