 LFD Book Forum Hw5 Q8 E_out

#1
 marek Member Join Date: Apr 2013 Posts: 31 Hw5 Q8 E_out

I am struggling to understand how to calculate in this question. I have two competing theories, which I will describe below. Any help is greatly appreciated.

Once the algorithm terminates, I have . I now generate a new set of data points . Using my original target function to generate the corresponding .

Case 1. Just use the same cross entropy error calculation but on this new data set. Case 2. Directly calculate the expected output of our hypothesis function and compare to . with probability Ultimately this gives us the probability that our hypothesis aligns with Y: In the lectures/book, we would multiply these probabilities to get the "likelihood" that the data was generated by this hypothesis. However, it seems that averaging over these should give the expected error in this sample. It feels as though the first approach is the correct one, but I struggle because the second approach makes intuitive sense since that is how I historically I would have calculated . To make matters worse, the two approaches very closely approximate different answers in the question!
#2 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,477 Re: Hw5 Q8 E_out

Quote:
 Originally Posted by marek I am struggling to understand how to calculate in this question. I have two competing theories, which I will describe below. Any help is greatly appreciated. Once the algorithm terminates, I have . I now generate a new set of data points . Using my original target function to generate the corresponding . Case 1. Just use the same cross entropy error calculation but on this new data set. The above approach is correct. The problem specifies the cross entropy error measure, so , where the expectation is w.r.t. both . The above formula estimates that through a random sample.
__________________
Where everyone thinks alike, no one thinks very much
#3
 marek Member Join Date: Apr 2013 Posts: 31 Re: Hw5 Q8 E_out

Quote:
 Originally Posted by yaser The above approach is correct. The problem specifies the cross entropy error measure, so , where the expectation is w.r.t. both . The above formula estimates that through a random sample.
I suspected as much. I'll try to figure out why my other approach is wrong tomorrow. I think I've burned out on it today and am probably not seeing something obvious. Thanks for your help!
#4
 arcticblue Member Join Date: Apr 2013 Posts: 17 Re: Hw5 Q8 E_out

I am also a little unsure about exactly how this equation works: Obviously the more negative is the closer E_out is to zero which is good. So is w supposed to be normalized? I presume so because otherwise I could just scale w and then E_out becomes very small. And if it is normalized then the values I'm getting for E_in and E_out are both much greater than any of the options. (Maybe it's meant to be like that, if so it's quite unnerving.)
#5 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,477 Re: Hw5 Q8 E_out

Quote:
 Originally Posted by arcticblue I am also a little unsure about exactly how this equation works: Obviously the more negative is the closer E_out is to zero which is good. So is w supposed to be normalized? I presume so because otherwise I could just scale w and then E_out becomes very small. And if it is normalized then the values I'm getting for E_in and E_out are both much greater than any of the options. (Maybe it's meant to be like that, if so it's quite unnerving.)
No normalization. The value of is determined iteratively by the specific algorithm given in the lecture. If 'agrees' with all the training examples, then indeed the algorithm will try to scale it up to get the value of the logistic function closer to a hard threshold. When you evaluate the quoted formula on a test set, is frozen and no scaling or any other change in it is allowed.
__________________
Where everyone thinks alike, no one thinks very much
#6
 Michael Reach Senior Member Join Date: Apr 2013 Location: Baltimore, Maryland, USA Posts: 71 Re: Hw5 Q8 E_out

Quote:
 If 'agrees' with all the training examples, then indeed the algorithm will try to scale it up to get the value of the logistic function closer to a hard threshold.
Thank you for this comment - I finally have some idea what I'm seeing in the homework. This point is worth stressing: the scale of w determines the sharpness of the threshold.
#7
 arcticblue Member Join Date: Apr 2013 Posts: 17 Re: Hw5 Q8 E_out

Thank you for explaining that normalization is not required. Your explanation now makes a bit more sense why I see the weights continue to increase in value the more iterations that I run.
#8
 hsolo Member Join Date: Jul 2013 Posts: 12 Re: Hw5 Q8 E_out

One very minor point which may help error prone folks such as myself:
In Linear methods we always have a d+1 dimensional weight vector by adding an extra pseudo-coordinate of 1 for each training and test point. I completely overlooked this and was struggling with the error never getting as small as the expected answer. Spent a long time rechecking code etc.

As soon as I fixed this, things fell into place. Likely I will never forget this :-)

 Thread Tools Show Printable Version Email this Page Display Modes Switch to Linear Mode 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 11:22 PM.