Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions