Question: The shape of the input features: 4 4 2 , 1 0 ? , The shape of the output varaible: 4 4 2 , ?

"The shape of the input features: 442,10?
,
"The shape of the output varaible: 442,?
"# Load the diabetes dataset ??
",
"diabetes_x, diabetes y= datasets.Load_diabetes(return_X_y=True)|n",
"print('The shape of the input features:', diabetes_X. shape) In",
"print('The shape of the output varaible:', diabetes y.shape)"
"# Use only one feature ??
",
"diabetes_X_one = diabetes_X[:, np.newaxis, 2]??
",
"print(diabetes_X_one.shape)"
"## Dataset split |n,
"In",
"Now, we split the dataset into two parts: training set and test set. 1n",
"In",
"- training set: 422 samples ??
,
"- test set: 20 samples "
"Assume that we have a hypothesis $$h-{||}(x)=|| theta_+|| theta_1 x. $$?
,
"In",
"Your tasks: In",
"In",
,
"|n",
"[IMPORTANT] Do not just call the least square function from libraries, for example, 1n",
"scipy.optimize.least_squares from scipy. Doing so will result in 0 point. Using helping functions such as numpy.linalg.inv is okay. In",
"In",
"1n",
"[NOTE] Notice that the loss function is mean-squared error. In",
"1n",
"-[3pts] derive the analytical expression of the gradient if the loss is defined as 1n,
theta ||2???2,$$|n'',
"In",
"To check whether your computation is correct, consider using an API such as Scikit learn linearregression."
 "The shape of the input features: 442,10? , "The shape of

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!