LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Chapter 3 - The Linear Model (http://book.caltech.edu/bookforum/forumdisplay.php?f=110)
-   -   Classifying Handwritten Digits: 1 vs. 5 (http://book.caltech.edu/bookforum/showthread.php?t=2063)

 nahgnaw 10-10-2012 08:50 PM

Classifying Handwritten Digits: 1 vs. 5

I don't quite understand the first classification method given by the problem: "Linear Regression for classiﬁcation followed by pocket for improvement". Since the weight returned by linear regression is an analytically optimal result, how can the pocket algorithm improve it?

 magdon 10-11-2012 08:11 AM

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 (Post 6270) I don't quite understand the first classification method given by the problem: "Linear Regression for classiﬁcation followed by pocket for improvement". Since the weight returned by linear regression is an analytically optimal result, how can the pocket algorithm improve it?

 rpistu 10-11-2012 11:53 PM

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.

 nahgnaw 10-12-2012 12:44 PM

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%.

 mileschen 10-12-2012 01:15 PM

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.

 magdon 10-12-2012 01:16 PM

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 (Post 6301) 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.

 nahgnaw 10-12-2012 01:18 PM

Re: Classifying Handwritten Digits: 1 vs. 5

Quote:
 Originally Posted by mileschen (Post 6324) 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.

 rpistu 10-12-2012 04:31 PM

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?

 magdon 10-12-2012 05:23 PM

Re: Classifying Handwritten Digits: 1 vs. 5

Binary classification error.

Quote:
 Originally Posted by rpistu (Post 6336) 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?

 rpistu 10-13-2012 01:11 AM

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?

All times are GMT -7. The time now is 11:59 PM.