 LFD Book Forum Homework#6 Q3
 Register FAQ Calendar Mark Forums Read #1
 invis Senior Member Join Date: Jul 2012 Posts: 50 Homework#6 Q3

I have some problems with understanding the question #3.

Ok, we have a formula for linear regression with regularization: But I cant catch this:
"add the term to the squared in sample error"

What I suppose to use in this formula ? The without regularization ? And why adding to squared error ? #2 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478 Re: Homework#6 Q3

Quote:
 Originally Posted by invis What I suppose to use in this formula ? The without regularization ? And why adding to squared error ? The solution (notice the plus sign) comes from solving the case of augmented error where the regularization term is added to the in-sample mean-squared error.
__________________
Where everyone thinks alike, no one thinks very much
#3
 invis Senior Member Join Date: Jul 2012 Posts: 50 Re: Homework#6 Q3

Just one more question ... at this time

Why when we computing there is no eye matrix ? We do the same divide to w by .

But eye matrix appears when we divide by w. That confusing me.
#4 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478 Re: Homework#6 Q3

Quote:
 Originally Posted by invis Just one more question ... at this time Why when we computing there is no eye matrix ? We do the same divide to w by . But eye matrix appears when we divide by w. That confusing me.
The "divide by" is in fact multiplying by a matrix inverse. In the case of augmented error, in order to put things in terms of a matrix, we write as , then factor out which becomes the matrix to be inverted. In the linear regression case, there is no term (or you can think of it as killing that term).
__________________
Where everyone thinks alike, no one thinks very much
#5
 ESRogs Member Join Date: Jul 2012 Posts: 12 Re: Homework#6 Q3

In the lecture, the formula for was derived for the case where the weights were being multiplied by Legendre polynomials. Is it still valid when the set of transformations is different, such as those specified in the problem?
#6 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478 Re: Homework#6 Q3

Quote:
 Originally Posted by ESRogs In the lecture, the formula for was derived for the case where the weights were being multiplied by Legendre polynomials. Is it still valid when the set of transformations is different, such as those specified in the problem?
The formula is valid for any nonlinear transformation into a .
__________________
Where everyone thinks alike, no one thinks very much
#7
 melipone Senior Member Join Date: Jan 2013 Posts: 72 Re: Homework#6 Q3

Quote:
 Originally Posted by yaser The solution (notice the plus sign) comes from solving the case of augmented error where the regularization term is added to the in-sample mean-squared error.
I am confused. Are we supposed to rederive the result of Slide 11?
#8 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478 Re: Homework#6 Q3

Quote:
 Originally Posted by melipone I am confused. Are we supposed to rederive the result of Slide 11?
No rederivation needed. You can always use the results given in the lectures.
__________________
Where everyone thinks alike, no one thinks very much
#9
 Kekeli Junior Member Join Date: Apr 2013 Posts: 6 Re: Homework#6 Q3

My answers for any value of K are order(s) of magnitude higher that the options.

w_reg = (Z^\top Z + λI)^-1 Z^T y

As a Python noob, perhaps someone can confirm that I need the linalg.inv of the first term in parentheses, because we cannot use the pinv method when the weight term is present.
thanks.

Last edited by Kekeli; 05-13-2013 at 06:04 AM. Reason: Realized the upper bound isn't the issue
#10
 jlaurentum Member Join Date: Apr 2013 Location: Venezuela Posts: 41 Re: Homework#6 Q3

Kekeli:

I don't know about Python, but in R I was using the "chol2inv" function of the "Matrix" library to find the matrix inverse. It turns out this wasn't the right tool for the job. I ended up using "solve" from the base package to find the inverse. So in R, I used the following functions:
1. t(M) for the transpose of an M matrix
2. %*% for matrix-matrix or matrix-vector multiplication (or inner product)
3. diag(...) to generate a diagonal matrix such as needed for the part.
4. solve(M) to find the inverse of an M matrix. Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General     General Discussion of Machine Learning     Free Additional Material         Dynamic e-Chapters         Dynamic e-Appendices Course Discussions     Online LFD course         General comments on the course         Homework 1         Homework 2         Homework 3         Homework 4         Homework 5         Homework 6         Homework 7         Homework 8         The Final         Create New Homework Problems Book Feedback - Learning From Data     General comments on the book     Chapter 1 - The Learning Problem     Chapter 2 - Training versus Testing     Chapter 3 - The Linear Model     Chapter 4 - Overfitting     Chapter 5 - Three Learning Principles     e-Chapter 6 - Similarity Based Methods     e-Chapter 7 - Neural Networks     e-Chapter 8 - Support Vector Machines     e-Chapter 9 - Learning Aides     Appendix and Notation     e-Appendices

All times are GMT -7. The time now is 01:44 AM. The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.