I am new to machine learning. For a sample formula , y= 5 + 10(x^2), I generated x and y values and applied linear regression for it. The theta1 and theta2 values I received was for a straight line with large cost. How do I modify linear regression algorithm to get the exact values of theta1 = 5 and theta2 = 10?
Asked
Active
Viewed 896 times
0
-
Not Clear!!! Can you put more light?? – Devavrata Feb 06 '15 at 06:55
-
In short, if I have a dataset which represents a quadratic equation, how do I get the coefficients of x^2 using linear regression. – Mallik Feb 06 '15 at 07:27
-
Can you elaborate a little more..how do I get the let loss function and apply to linear regression? – Mallik Feb 06 '15 at 07:43
-
It is basically a approach. Here you know that data follow quadratic equation but in real cases we are unaware that which polynomial equation to use. So we usually use a one degree line equation and try to fit the data in that line by Linear regression. Basically `hypothesis` have some difference from actual equation therefore we take a distance b/w actual & predicted & try to reduce that is `Loss function` which we usually is square of difference b/w actual & predicted y. – Devavrata Feb 06 '15 at 07:55
-
Thanks, I think I got the answer. As long as I have the hypothesis evaluated inside the linear regression which is a quadratic or polynomial -equation, we should be able to get the coefficients back correctly – Mallik Feb 06 '15 at 09:37