LFD Book Forum  

Go Back   LFD Book Forum > Book Feedback - Learning From Data > Chapter 3 - The Linear Model

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2012, 09:50 PM
nahgnaw nahgnaw is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Default Classifying Handwritten Digits: 1 vs. 5

I don't quite understand the first classification method given by the problem: "Linear Regression for classification followed by pocket for improvement". Since the weight returned by linear regression is an analytically optimal result, how can the pocket algorithm improve it?
Reply With Quote
  #2  
Old 10-11-2012, 09:11 AM
magdon's Avatar
magdon magdon is offline
RPI
 
Join Date: Aug 2009
Location: Troy, NY, USA.
Posts: 595
Default Re: Classifying Handwritten Digits: 1 vs. 5

It is only analytically optimal for regression. It can be suboptimal for classification.

Quote:
Originally Posted by nahgnaw View Post
I don't quite understand the first classification method given by the problem: "Linear Regression for classification followed by pocket for improvement". Since the weight returned by linear regression is an analytically optimal result, how can the pocket algorithm improve it?
__________________
Have faith in probability
Reply With Quote
  #3  
Old 10-12-2012, 12:53 AM
rpistu rpistu is offline
Member
 
Join Date: Oct 2012
Posts: 10
Default Re: Classifying Handwritten Digits: 1 vs. 5

Hi Professor, you said that the weight vector w learnted from the Linear Regression could be suboptimal for classification. However, after run the pocket algorithm with 1,000,000 iteration, the w still not change, which means that the w learnt from the Linear Regression is optimal. Is that true? Maybe I made some mistake.
Reply With Quote
  #4  
Old 10-12-2012, 01:44 PM
nahgnaw nahgnaw is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Default Re: Classifying Handwritten Digits: 1 vs. 5

The pocket algorithm indeed is able to improve the linear regression. Mine decreased the in-sample error from 0.8% to around 0.4%.
Reply With Quote
  #5  
Old 10-12-2012, 02:15 PM
mileschen mileschen is offline
Member
 
Join Date: Sep 2012
Posts: 11
Default Re: Classifying Handwritten Digits: 1 vs. 5

Do you set the w learnt from Linear Regression as the initial w for Pocket Algorithm? I did like that, but without any improvement. Maybe some mistakes.
Reply With Quote
  #6  
Old 10-12-2012, 02:16 PM
magdon's Avatar
magdon magdon is offline
RPI
 
Join Date: Aug 2009
Location: Troy, NY, USA.
Posts: 595
Default Re: Classifying Handwritten Digits: 1 vs. 5

Any one of these three can happen:

1) the linear regression weights are optimal
2) the linear regression weights are not optimal and the PLA/Pocket algorithm can improve the weights.
3) the linear regression weights are not optimal and the PLA/Pocket algorithm cannot improve the weights.

In practice, we will not know which case we are in because actually finding the optimal weights is an NP-hard combinatorial optimization problem.

However, no matter which case we are in, other than some extra CPU cycles, there is no harm done in running the pocket algorithm on the regression weights to see if they can be improved.


Quote:
Originally Posted by rpistu View Post
Hi Professor, you said that the weight vector w learnted from the Linear Regression could be suboptimal for classification. However, after run the pocket algorithm with 1,000,000 iteration, the w still not change, which means that the w learnt from the Linear Regression is optimal. Is that true? Maybe I made some mistake.
__________________
Have faith in probability
Reply With Quote
  #7  
Old 10-12-2012, 02:18 PM
nahgnaw nahgnaw is offline
Junior Member
 
Join Date: Aug 2012
Posts: 4
Default Re: Classifying Handwritten Digits: 1 vs. 5

Quote:
Originally Posted by mileschen View Post
Do you set the w learnt from Linear Regression as the initial w for Pocket Algorithm? I did like that, but without any improvement. Maybe some mistakes.
Yes, I did. I guess you probably should look at your implementation of the pocket algorithm. I also got no improvement at first. But then I messed around the code a little bit, and it worked.
Reply With Quote
  #8  
Old 10-12-2012, 05:31 PM
rpistu rpistu is offline
Member
 
Join Date: Oct 2012
Posts: 10
Default Re: Classifying Handwritten Digits: 1 vs. 5

Does the in-samle-error should use the square error formula, like the one of Linear Regression? Or the in-sample-error of binary function?
Reply With Quote
  #9  
Old 10-12-2012, 06:23 PM
magdon's Avatar
magdon magdon is offline
RPI
 
Join Date: Aug 2009
Location: Troy, NY, USA.
Posts: 595
Default Re: Classifying Handwritten Digits: 1 vs. 5

Binary classification error.

Quote:
Originally Posted by rpistu View Post
Does the in-samle-error should use the square error formula, like the one of Linear Regression? Or the in-sample-error of binary function?
__________________
Have faith in probability
Reply With Quote
  #10  
Old 10-13-2012, 02:11 AM
rpistu rpistu is offline
Member
 
Join Date: Oct 2012
Posts: 10
Default Re: Classifying Handwritten Digits: 1 vs. 5

How to plot the training and the test data, together with the separators learnt by using a 3rd order polynomial transform. Actually, the 3rd order polynomial hypothesis is a unclear formula with the two features. Then, how to plot this polynomial hypothesis in a two dementional axis?
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 03:38 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.