LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 2

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2012, 05:37 PM
samirbajaj samirbajaj is offline
Member
 
Join Date: Jul 2012
Location: Silicon Valley
Posts: 48
Default 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
Reply With Quote
  #2  
Old 07-17-2012, 08:36 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Linear Regression

Quote:
Originally Posted by samirbajaj View Post
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.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 07-23-2012, 05:30 AM
nedqlko.m nedqlko.m is offline
Junior Member
 
Join Date: Jul 2012
Posts: 7
Default 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!
Reply With Quote
  #4  
Old 07-23-2012, 09:22 AM
samirbajaj samirbajaj is offline
Member
 
Join Date: Jul 2012
Location: Silicon Valley
Posts: 48
Default Re: Linear Regression

Quote:
Originally Posted by nedqlko.m View Post
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
Reply With Quote
  #5  
Old 07-23-2012, 10:59 AM
nedqlko.m nedqlko.m is offline
Junior Member
 
Join Date: Jul 2012
Posts: 7
Default Re: Linear Regression

Quote:
Originally Posted by samirbajaj View Post
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.
Reply With Quote
Reply

Tags
linear regression

Thread Tools
Display Modes

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 Jump


All times are GMT -7. The time now is 05:26 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, 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.