Question: Please do in python 2 . 1 . ( Linear regression, 2 5 points ) We have a labeled dataset D = { ( x

Please do in python
2.1.(Linear regression, 25 points) We have a labeled dataset D ={(x1, y1),(x2, y2),
,(xn, yn)}, with xi in Rd being the d-dimensional feature vector of the i-th sample, and yi in R being real valued target (label).
A linear regression model is give by
fw0,...,wd(x)=w0+w1x1+w2x2++wdxd,(1)
where w0 is often called bias and w1, w2,..., wd are often called coefficients.
Now, we want to utilize the dataset D to build a linear model based on linear regression. We provide a training set Dtrain that includes 2024 labeled samples with 11 features (See lin- ear regression train.txt) to fit model, and a test set Dtest that includes 10 unlabeled samples with 11 features (see linear regression test.txt) to estimate model.
1. Using the LinearRegression class from Sklearn package to get the bias w0 and the coefficients w1, w2,..., w11, then computing the y= f(x) of test set Dtest by the model trained well. (Put the estimation of w0, w1,..., w11 and these y in your answers.)

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!