Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We are interested in performing ordinary least squares regression given data x , Y to find parameters , 0 that minimize the mean squared error

We are interested in performing ordinary least squares regression given data x,Y to find parameters ,0 that minimize the mean squared error objective:
J(,0)=1ni=1nLs(x(i),y(i);s0)
where the squared loss is
Ls(x(i),y(i);,0)=(hat(y)(i)-y(i))2=(Tx(i)+0-y(i))2
Note that the Ls(x(i),y(i);,0) notation here is used to emphasize that the loss depends on both the data sample (x(i),y(i)), and the parameters, and 0. Compared to the Ls notation as used in some part of the notes and the lab, we see that Ls(x(i),y(i);,0)=Ls(h(x(i);,0),y(i)), where h(x(i);,0)=Tx(i)+0. Now implement ** as found in the previous problem, using symbols x and Y for the data matrix and outputs, and np.dot(or @ shorthand), np.transpose (or . T shorthand), np.linalg.inv.
# Enter an expression to compute and set th to the optimal theta th = None
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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 3 Lnai 9853

Authors: Bettina Berendt ,Bjorn Bringmann ,Elisa Fromont ,Gemma Garriga ,Pauli Miettinen ,Nikolaj Tatti ,Volker Tresp

1st Edition

3319461303, 978-3319461304

Students also viewed these Databases questions