LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2012, 11:41 AM
munchkin munchkin is offline
Member
 
Join Date: Jul 2012
Posts: 38
Default Calculating The "Average" Function Of Xn

Page 63 seems to be saying this:

For each data set, evaluate the hypothesis for that data and save it somewhere. When all of the data has been processed take each data point and calculate the "average" value of that data point evaluated against each of the previously generated hypotheses. That average value can be used to calculate the variance of the data set.

So this is just a straightforward averaging calculation, is it not? I'm having some difficulty duplicating the variance values shown in the examples from the book and suspect that this calculation may be the source of the problem.

Thanks for your attention.
Reply With Quote
  #2  
Old 08-05-2012, 02:28 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,476
Default Re: Calculating The "Average" Function Of Xn

Quote:
Originally Posted by munchkin View Post
For each data set, evaluate the hypothesis for that data and save it somewhere. When all of the data has been processed take each data point and calculate the "average" value of that data point evaluated against each of the previously generated hypotheses. That average value can be used to calculate the variance of the data set.
Just to clarify. After you have calculated the various hypotheses based on different data sets, you evaluate these hypotheses on a generic point {\bf x} (not necessarily belonging to any data set used for training). The average value you get will be \bar g ({\bf x}) and the variance in the values you get will be {\bf var}({\bf x}). The expected value of {\bf var}({\bf x}) with respect to {\bf x} (based on the uniform probability of generating {\bf x}) is the variance {\bf var}. Is this what you have calculated?
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 08-05-2012, 04:44 PM
munchkin munchkin is offline
Member
 
Join Date: Jul 2012
Posts: 38
Default Re: Calculating The "Average" Function Of Xn

Thanks for your quick reply. I have managed to duplicate the variance result for hypothesis zero of example 2.8. The error had nothing to do with averaging. I don't use a generic x but simply calculate the average of all of the g's generated by the test data sets. This averaged g is evaluated at each data point where comparison with g(x) is required. It seems to work for the constant value case.

The book says that the average g is calculated for "a particular x" and is interpreted as the expected value of the random variable gbar(X). Is this particular x value the "generic" value?
Reply With Quote
  #4  
Old 08-05-2012, 09:05 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,476
Default Re: Calculating The "Average" Function Of Xn

Quote:
Originally Posted by munchkin View Post
The book says that the average g is calculated for "a particular x" and is interpreted as the expected value of the random variable gbar(X). Is this particular x value the "generic" value?
Correct. This is just to simplify the concept, but your approach of getting the whole \bar g at once is certainly valid.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
Reply

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 07:09 PM.


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.