LFD Book Forum Hard to understand what is wanted in HW2, Q6
 User Name Remember Me? Password
 Register FAQ Calendar Mark Forums Read

 Thread Tools Display Modes
#1
04-10-2013, 11:14 AM
 Katie C. Member Join Date: Apr 2013 Posts: 17
Hard to understand what is wanted in HW2, Q6

I am confused about what to do in Question 6. Reading the previous posts on the forum only made me more confused.

To clarify I am using the following variable names:
N = # of points in the training set
Ntest = # of points in the testing set
Nexp = # Number of runs of the experiment

In question 6, Ntest = 1000 and Nexp = 1000 and we use N=100 of question 5.

Am I correct in assuming that for each of the Nexp runs we:
1. Generate f(x)
2. Generate N training points
3. Estimate g(x)
4. Generate Ntest testing points
5. Evaluate g(x) on the Ntest testing points and record the Eout for that run.

After completing Nexp runs, average the Eout values to get a final estimate for Eout.

*OR* do we only perform steps 1-3 one time and then repeat steps 4 and 5 Nexp times?
#2
04-10-2013, 11:53 AM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Hard to understand what is wanted in HW2, Q6

Quote:
 Originally Posted by Katie C. N = # of points in the training set Ntest = # of points in the testing set Nexp = # Number of runs of the experiment In question 6, Ntest = 1000 and Nexp = 1000 and we use N=100 of question 5. Am I correct in assuming that for each of the Nexp runs we: 1. Generate f(x) 2. Generate N training points 3. Estimate g(x) 4. Generate Ntest testing points 5. Evaluate g(x) on the Ntest testing points and record the Eout for that run. After completing Nexp runs, average the Eout values to get a final estimate for Eout.
Hi,

You got it.
__________________
Where everyone thinks alike, no one thinks very much
#3
04-14-2013, 01:04 PM
 jtsengcr Junior Member Join Date: Apr 2013 Posts: 3
Re: Hard to understand what is wanted in HW2, Q6

Are you sure? My thought for question 5 and 6 was:

1. Generate target function f(x1, x2) only once.
2. Generate a large data set D (x1, x2, y) where y = f(x1, x2).

loop 1000 times
1. Take 100 points from D in space limited for training.
2. Linear regression using the 100 training points for g(x1, x2).
3. Evaluate whether g(x1, x2) = y for the 100 training points, get Ein.
4. Take 1000 points from D in space reserved for testing.
5. Evaluate whether g(x1, x2) = y for the 1000 testing points, get Eout.

Average Ein.
Average Eout.

I did not get the right answer, so, please correct my logic.
#4
04-14-2013, 02:02 PM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Hard to understand what is wanted in HW2, Q6

Quote:
 Originally Posted by jtsengcr Are you sure? My thought for question 5 and 6 was: 1. Generate target function f(x1, x2) only once. 2. Generate a large data set D (x1, x2, y) where y = f(x1, x2).
When you do this, the results will depend on which target function you have. By generating a random target function every time, you take out that dependency. Of course you can be lucky in the above scenario and get a target function that is typical rather than odd, so you end up with the same answer.
__________________
Where everyone thinks alike, no one thinks very much

 Thread Tools Display Modes Hybrid 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:55 AM.

 Contact Us - LFD Book - Top

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.