LFD Book Forum  

Go Back   LFD Book Forum > Book Feedback - Learning From Data > Chapter 1 - The Learning Problem

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2013, 04:06 PM
scottedwards2000 scottedwards2000 is offline
Junior Member
 
Join Date: Jan 2013
Posts: 9
Default How is linearity of PLA obvious?

The perceptron learning algo is very cool in its simplicity, but, although it was introduced in the course as sort of obviously linear, that was immediately apparen to me. Just wondering what made it obvious to others if it was. Is it the formula on page 6 (w-sub1*x-sub1 + w-sub2*x-sub2 + b = 0)? That seems similar to the old line equation of y=mx+b but not exactly same. However, after playing on paper with different choices of w's and b, I think I see that regardless of what values I choose for the weights and threshold that a line is formed. But how is that obvious theoretically that the shape is a line, without trying various values like i did?
Reply With Quote
  #2  
Old 01-13-2013, 05:12 PM
magdon's Avatar
magdon magdon is offline
RPI
 
Join Date: Aug 2009
Location: Troy, NY, USA.
Posts: 595
Default Re: How is linearity of PLA obvious?

It is not obvious at all, and for this reason I would recommend Problem 1.2 in the text in case anyone is having similar doubts.

The classification function: \mathbf{w}^T\mathbf{x}>0\implies +1 is called linear because the weights appear 'linearly' in this formula. Now to see that this corresponds to what in high-school we learned as a line requires a little algebra.

First, the classification function is not a line. The classification function is given by the formula above which assigns +1 to some regions of the space and -1 to others. What corresponds to the line is the boundary between the region where the hypothesis is +1 and the region where the hypothesis is -1. It is the separator that is a line.

Fix \mathbf{w}. The boundary corresponds exactly to those points \mathbf{x} for which

\mathbf{w}^T\mathbf{x}=0.

Lets consider the case in 2-dim. Then \mathbf{w}=[w_0,w_1,w_2] and \mathbf{w}^T\mathbf{x}=0 translates to

w_0+w_1x_1+w_2x_2=0.

Rearrange a little and you have the following equation:

x_2=\frac{-w_0}{w_2}+\frac{-w_1}{w_2}x_1

that must be satisfied by any point \mathbf{x}=[x_1,x_2] that lies on the decision boundary. Thus, the decision boundary is indeed a line, and one can identify m=-w_1/w_2, b=-w_0/w_2.

Quote:
Originally Posted by scottedwards2000 View Post
The perceptron learning algo is very cool in its simplicity, but, although it was introduced in the course as sort of obviously linear, that was immediately apparen to me. Just wondering what made it obvious to others if it was. Is it the formula on page 6 (w-sub1*x-sub1 + w-sub2*x-sub2 + b = 0)? That seems similar to the old line equation of y=mx+b but not exactly same. However, after playing on paper with different choices of w's and b, I think I see that regardless of what values I choose for the weights and threshold that a line is formed. But how is that obvious theoretically that the shape is a line, without trying various values like i did?
__________________
Have faith in probability
Reply With Quote
  #3  
Old 01-31-2013, 12:37 AM
scottedwards2000 scottedwards2000 is offline
Junior Member
 
Join Date: Jan 2013
Posts: 9
Default Re: How is linearity of PLA obvious?

Thanks Dr. Magdon-Ismail, that was very helpful. I'm glad it wasn't obvious! Just to ensure I understand it correctly, the way I'm conceptualizing it is slightly differently, but I hope is still correct. I see the function being in 3-d space, with y (the output) as the vertical axis, and x_1 and x_2 forming the "horizontal plane." If you plot all the points, such that y=w_0+w_1x_1+w_2x_2 you would get a tilted plane, that intersects the y axis at w_0. The boundary line would then be all values of x_1 and x_2 which results in y=0.

If you imagine looking straight down on this tilted plane (so it does not appear tilted anymore), the points where y=0 would form a straight line.

Is this a correct way of conceptualizing it?

Also, since this process reminded me of multiple regression, it occurred to me that you could get a curved boundary if you included interaction terms in the equation; however this would require another weight/parameter, and I doubt the PLA algorithm would still work, since it depends on the angle between straight lines.

Finally, just to confirm another suspicion, since there are 3 unknowns in your explication above, it is impossible to derive the 3 weights from just being given the boundary line (e.g. two points in the x_1 x_2 space) - correct?
Reply With Quote
  #4  
Old 03-30-2013, 06:14 AM
Elroch Elroch is offline
Invited Guest
 
Join Date: Mar 2013
Posts: 143
Default Re: How is linearity of PLA obvious?

May I add a technical point to the answer: for maximum generality, it is necessary to deal with all possible cases of the weight parameters.

The case where parameter w2 is non-zero was dealt with by magdon. The case where w1 is non-zero is similarly shown to a straight line separator in the plane. But if both w1 and w2 are zero, there is no separation: the perceptron function is a constant for all points (1, x1, x2). This does not cause any problems with the operation of the algorithm, as one step of the algorithm stops this being so.

To be maximally pedantic, in the case where the input data set consists of the one point (1, x1, x2)=(1, 0, 0) with y either +1 or -1, and we start with w1=w2=0, the perceptron algorithm still works (in one step) but it never gives a line in the plane.
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 06:45 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.