Question: Problem 5 ( Coding ) 1 1 pts: For the following tasks use the following California House Price Data: [ 1 ] 1 from sklearn.datasets
Problem Coding pts:
For the following tasks use the following California House Price Data:
from sklearn.datasets import fetchcaliforniahousing
housing fetchcaliforniahousing
dataX pdDataFramehousingdata columns housing.featurenames
dataXhead
datay housing.target
datay
arraydots,
Split the dataset into training and test sets of : ratio use randomseed and testsize
You must train the linear regression model using the training data and compute MSE using the test
dataset.
Perform Multiple linear regression using gradient descent optimization technique. You must not use
any direct package for this. You should generate the parameters intercepts & coefficients initial values
from standard normal distribution. Number of iterations should be minimum of
a pts Mention: loss function, initial values of parameters should be generated from Standard
Normal Distribution: hyperparameters, and partial derivatives of the loss function
with respect to intercept and coefficients
b pts Write a function that takes input as arguments of hyperparameters and provides
output: best set of optimal parameters intercept and coefficients and the loss cost
c pt Plot learning curve where axis will be number of iteration and axis will be loss for each
iteration and explain the curve
d pts Form the regression equation using the optimal parameters and find hatpredict for each
datapoints of test show in DataFrame including two columns: yactual & hatypredict
e pts Finally, for the test dataset: Find Mean Squared Error MSE
f pts Indicate whether your model is experiencing overfitting. Explain.
g Extra Points: The model that achieves the lowest MSE on the test data will be awarded bonus
points.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
