Question: # Gradient Descent: Linear regression with two variables # In this Assignment you are going to solve a linear regression problem with 2 variables and

# Gradient Descent: Linear regression with two variables
# In this Assignment you are going to solve a linear regression problem with 2 variables and 1000 observations.
# Let us create and load the data.
from sklearn.linear_model import LinearRegression
from sklearn.datasets import make_regression
import numpy as np
X,Y = make_regression(n_samples =1000, n_features=2, n_informative=2, n_targets=1, bias=10, coef= False, noise =20, random_state=0)
# without scaling
theta0=0
theta1=0
theta2=0
n_iters =1000 #Maximum number of iterations
precision =0.0001 # The precision value to stop the algorithm
# Continue from HERE .........
Solve the given linear regression problem using gradient descent without scaling.

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 Programming Questions!