Question: 2. For a linear regression problem suppose we have just a single variable x. a. Write down the hypothesis function. b. Consider the following datapoints

2. For a linear regression problem suppose we have just a single variable x. a. Write down the hypothesis function. b. Consider the following datapoints (x,y) = (166, 54), (195, 82), (200, 72), (260, 72), (265, 90), (335, 124), (370, 94), (450, 118), (517, 152), (552, 132). Write a code in python or any other language that you prefer to find the values of the coefficients of the hypothesis function that fits the data best. You should use gradient descent algorithm. Print the outputs and the fitted function along with the data. c. Assume instead of the single variable x you also use x2 as the 2nd variable in the hypothesis function. Update your code for question 2(b) to find the coefficients for this regression problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!