Question: In this assignment, you will implement Linear Regression algorithm with Gradient Descent minimization algorithm in Python. To dos: Implement Linear Regression algorithm Implement Gradient Descent
In this assignment, you will implement Linear Regression algorithm with Gradient Descent minimization algorithm in Python.
To dos:
Implement Linear Regression algorithm
Implement Gradient Descent algorithm
Implement data visualization using import matplotlib.pyplot:
o Scatter plot each pair of (x,y) (x and y explained below)
o Plot regression line for every other 5 iterations of gradient descent
o Make sure data and regression line are in different colors
Let the first column of the data set be the explanatory variable x (e.g. sqft of houses), and let the second column be the dependent variable y (e.g. prices of houses). Let m (e.g. training dataset size) be the number of rows in this m x 2 training dataset matrix.
Let user enter:
m x 2 data frame as input. Assume this data frame variable name is df . Your linear regression function should get df as a function argument and determine m from its size.
learning rate
maximum number of iterations. Even though the global minimum is not found in less than the given maximum number of iterations, end Gradient Descent minimization at that iteration. If the global minimum is found before the maximum number of iteration then stop Gradient Descent since minimum is already found
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
