Question: 2. [10 points) For a linear regression problem suppose we have just a single variable x. a. Write down the hypothesis function. b. Consider the

2. [10 points) 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 x as the 2nd variable in the hypothesis function. Update your code for question 2(b) to find the coefficients for this regression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
