Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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."
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

Discuss the key people management challenges that Dorian faced.

Answered: 1 week ago

Question

How fast should bidder managers move into the target?

Answered: 1 week ago