hypohesis = x0 +theta1 *(x1^2) +theta2*(x2^2))

Besides gradient decent , today i would introduce a new method to minimize the cost function. That's called normal equation(It's only useful to the linear regression problem) In order to apply to this method , we need to .

First we define :


Andrew Ng

 


Andrew Ng

X is called design matrix , then we can the following formular .

Andrew Ng

The normal quation method is useful when  numbers of the samples and features are both not too large. Beacause theta needed to calculate the inverse of the matrix.