Question: Problem 5 ( Coding ) 1 1 pts: For the following tasks use the following California House Price Data: [ 1 ] 1 from sklearn.datasets

Problem 5(Coding)11 pts:
For the following tasks use the following California House Price Data:
[1]1 from sklearn.datasets import fetch_california_housing
2 housing = fetch_california_housing()
[20]1 data_X= pd.DataFrame(housing['data'], columns = housing.feature_names)
2 data_X.head(2)
1 data_y = housing.target
2 data_y|
array([4.526,3.585,3.521,dots,0.923,0.847,0.894])
Split the dataset into training and test sets of 80:20 ratio (use random_seed 2024) and test_size =
0.20. 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 50.
a.(2 pts) Mention: loss function, initial values of parameters (should be generated from Standard
Normal Distribution: xN(0,1)), hyperparameters, and partial derivatives of the loss function
with respect to intercept and coefficients
b.(5 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.(1 pt) Plot learning curve where x-axis will be number of iteration and y-axis will be loss for each
iteration and explain the curve
d.(1 pts) Form the regression equation using the optimal parameters and find ( hat(y))(predict for each
datapoints of x?test)- show in DataFrame including two columns: y(y_actual) & hat(y)(y_predict)
e.(1 pts) Finally, for the test dataset: Find Mean Squared Error (MSE)
f.(1 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 2 bonus
points.
Problem 5 ( Coding ) 1 1 pts: For the following

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!