Question: Implement linear regression to predict Yscore . Use batch gradient descent as your optimization technique with the Least Mean Square objective function. Use a learning

Implement linear regression to predict Yscore . Use batch gradient descent as your optimization technique with the Least Mean Square objective function. Use a learning rate of r=103 and train for a maximum of T=10 epochs. Report your final LMS error on the test data, and provide a plot of the training error computed at each epoch. Initialze your parameters randomly from a normal distribution wiN(0,1). You will need to implement linear regression with no regularization, l1 regularization, and l2 regularizaiton.
First, modify the function below to initialize parameters by drawing from the normal distribution.
[]
# MODIFY THIS
def initialize_parameters(n):
"""
This function initializes the parameters by drawing from a normal distribution.
args:
n_features - the number of features to return a vector for
output:
w -( feature x 1 column vector )- vector of randomly initialized parameters"""
return np.random.normal(0,1,(n_features, 1))

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