[Machine Learning Ex2] Linear Regression with Multiple Variables

 

x2: midterm exam ^ 2, apply mean normalization:

mean value = (7921 + 5184 + 8836 +4761) / 4 = 6675.5

range = 8836-4761 = 4075

ans = (4761 - 6675./5) / 4075 = -0.47


 

 

 

It's increasing, so means it is overshotting.. so need to decrease the learning rate.


 

 

it is 5 features, but we need to count x0 as well, so 6 features, X = 23 * 6 matrix

y:  the same size the number of data, it should be vector as well, so 23 * 1


 

 

 

A) Data is small enough, instead of mulpti steps way to find theta by using GD, use NE is more efficient

B) Only apply when data is large, for example more than 1 000 000

C) Not the primay reason, GD can get stucked in local min... but by repeat a number of times with different starting point and learning rate, we can find global min

D) Nope.... 


 

 

 

A) Nope, NE actually doesnt' need feature scaling

B) Yes

C) Nope

D) the same as A

 

posted @ 2020-08-24 02:05  Zhentiw  阅读(183)  评论(0编辑  收藏  举报