LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 2 (http://book.caltech.edu/bookforum/forumdisplay.php?f=131)
-   -   Linear Regression (http://book.caltech.edu/bookforum/showthread.php?t=877)

samirbajaj 07-17-2012 05:37 PM

Linear Regression
 
Greetings!

A couple of questions regarding programming problems #6 and #7:

1) Re: problem 6: When computing E_out using results from the earlier exercise, do we take the result of just one iteration from that previous experiment, or the average of 1000 runs (i.e., the average parameter values)? I'm getting VASTLY different answers, depending on what I choose...please advise!

2) Re: problem 7: Am I to simply use the weights from #5 and plug them into the hw1 PLA code without modification? (I assume so, but wanted to be certain.)

Thanks.

-Samir

yaser 07-17-2012 08:36 PM

Re: Linear Regression
 
Quote:

Originally Posted by samirbajaj (Post 3486)
1) Re: problem 6: When computing E_out using results from the earlier exercise, do we take the result of just one iteration from that previous experiment, or the average of 1000 runs (i.e., the average parameter values)? I'm getting VASTLY different answers, depending on what I choose...please advise!

The average of 1000 runs.

Quote:

2) Re: problem 7: Am I to simply use the weights from #5 and plug them into the hw1 PLA code without modification? (I assume so, but wanted to be certain.
Correct.

nedqlko.m 07-23-2012 05:30 AM

Re: Linear Regression
 
I am a bit confused about Question #5. I have got a vector of E_in whose length is equal to the number of examples. Is this supposed to be so? And if yes, how do I then check my answer after 1000 runs - do I take the mean of the N (number of example) E_in values, or I am supposed to get a single value for E_in per each run?

Thanks very much in advance! Any help would be greatly appreciated!

samirbajaj 07-23-2012 09:22 AM

Re: Linear Regression
 
Quote:

Originally Posted by nedqlko.m (Post 3602)
I am a bit confused about Question #5. I have got a vector of E_in whose length is equal to the number of examples. Is this supposed to be so? And if yes, how do I then check my answer after 1000 runs - do I take the mean of the N (number of example) E_in values, or I am supposed to get a single value for E_in per each run?

E_in is the fraction of points that were classified incorrectly. You are to run your experiment 1,000 times, determine the E_in each time, and take the mean of all those results.

Hope that helps.

-Samir

nedqlko.m 07-23-2012 10:59 AM

Re: Linear Regression
 
Quote:

Originally Posted by samirbajaj (Post 3607)
E_in is the fraction of points that were classified incorrectly. You are to run your experiment 1,000 times, determine the E_in each time, and take the mean of all those results.

Hope that helps.

-Samir

Thanks very much for your reply! This does make sense, and I've just realised why I was initially confused about this - I always try to write my code to be as efficient as possible, and I was calculating this in a vectorised way (that's why I mentioned above that I've got a vector of values and not a single value) but in this particular case I had forgotten to sum up all elements of the vector.


All times are GMT -7. The time now is 04:50 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
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.