LFD Book Forum Question about Qs 7

#1
04-08-2013, 12:15 PM
 ykulkarni Junior Member Join Date: Apr 2013 Posts: 2

I haven't seen anyone else raise this question in the forum, so its probably something obvious that I'm missing to see. The question says:

"In each run, choose a random line in the plane as your target function f (do this by taking two random, uniformly distributed points in [-1,1] x [-1,1] and taking the line passing through them), where one side of the line maps to +1 and the other maps to 1."

Given a line, how do I figure out the function which separates points into +1 or -1 based on which side of the line they fall on?
#2
04-08-2013, 03:00 PM
 yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,477

Quote:
 Originally Posted by ykulkarni I haven't seen anyone else raise this question in the forum, so its probably something obvious that I'm missing to see. The question says: "In each run, choose a random line in the plane as your target function f (do this by taking two random, uniformly distributed points in [-1,1] x [-1,1] and taking the line passing through them), where one side of the line maps to +1 and the other maps to 1." Given a line, how do I figure out the function which separates points into +1 or -1 based on which side of the line they fall on?
Hi,

Indeed, one line can represent a function and its negation. Put the equation of the line in the form , where . The vector as well as its negation represent the same line. If you take the function to be , this fixes one of the two functions.
__________________
Where everyone thinks alike, no one thinks very much
#3
04-08-2013, 03:10 PM
 dazemoon Junior Member Join Date: Apr 2013 Posts: 1

You have 2 points defining the line, so one simple way is to express the line as y= a*x + b (see e.g. http://en.wikipedia.org/wiki/Linear_...Two-point_form)
then for any point P= (Px, Py) you can verify if Py > a*Px + b so that:
f maps P to 1 if [Py > a*Px + b], otherwise it maps P to -1. Or you can invert the mapping.
#4
04-08-2013, 04:06 PM
 Elroch Invited Guest Join Date: Mar 2013 Posts: 143

Two other related concepts that you can use relate an arbitrary two points A and B on the line to a third point C not on it. The first is the sine of the angle between AB and AC (which can never be zero, but which can have either sign), and the second is the cross product of AB and AC (which will always be perpendicular to the plane, but which can be either up or down).
#5
04-09-2013, 10:58 AM
 ykulkarni Junior Member Join Date: Apr 2013 Posts: 2

Quote:
 Originally Posted by yaser Hi, Indeed, one line can represent a function and its negation. Put the equation of the line in the form , where . The vector as well as its negation represent the same line. If you take the function to be , this fixes one of the two functions.
Thank you Professor, this makes it clear to me.

-Yogi

 Thread Tools Display Modes Linear 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 10:35 AM.