Here, I have tried to implement linear regression using Normal Equation, ie. using matrix forms.
theta = inv(X'X).(X'Y) , where...
- theta is coefficient vector
- Y is dependent variable vector
- X is matrix containing independent variables, with an additional row of 1's for intercept
- no need to choose alpha -> learning rate
- no need to iterate
- no need to normalize the data
- slow if n is too large (~10000)
- Redundant features: some are linearly dependent on each other
- Too many features: (m < n)
- delete some features
- use regularization