Question: In this Assignment, you are asked to implement a linear regression model using the gradient descent method from scratch using your preferred language (e.g., Java,
In this Assignment, you are asked to implement a linear regression model using the gradient descent method from scratch using your preferred language (e.g., Java, Python).
1. Create a data set of 100 records where each record has two values, and . The values range from 1 to 100 and is defined as follows = 2 + , where is a real random number between 5 and 5.
2. Plot your data set.
3. Implement linear regression using the gradient descent method (using 100 iterations) in your preferred language and test it using 3 values of the step size variable, , (i.e. 0.0001, 0.001, 0.1). Which value yields the best performance as measured by the cost/loss function, ()?
4. Plot the evolution of the () vs. number of iterations.
5. Plot your data set with fitted line generated by your linear regression model.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
