Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# 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

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

How should Apple compete? And how should Apple implement strategy?

Answered: 1 week ago

Question

What motivates you to work hard?

Answered: 1 week ago