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)

 magdon 10-13-2012 06:15 AM

Re: Classifying Handwritten Digits: 1 vs. 5

This thread has a response that might help:

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

Re: Classifying Handwritten Digits: 1 vs. 5

Hello Professor Magdon,

I have a slightly different question related to plotting.
When I am asked to "familiarize yourself with the data by giving a plot of two
of the digit images", what do we mean by plotting the data? Are we referring to
generating a digit image from the greyscale value vector? Or are you referring to
somehow plotting the numerical values in the vector, itself? I have a feeling that it is
the former, but I am not familar with image generation from greyscale pixels.

Any guidance you could provide would be greatly appreciated.

 magdon 10-04-2013 09:58 AM

Re: Classifying Handwritten Digits: 1 vs. 5

If you go to www.amlbook.com, click on 'supporting material' on the right and then scroll down to the `Data' section, you will find some information that can be of use. In particular, there is matlab code for plotting the digit images which takes the matrix of grayscale values and plots an image. This can be of help for developing your own code and utilities.

Quote:
 Originally Posted by admas (Post 11519) Hello Professor Magdon, I have a slightly different question related to plotting. When I am asked to "familiarize yourself with the data by giving a plot of two of the digit images", what do we mean by plotting the data? Are we referring to generating a digit image from the greyscale value vector? Or are you referring to somehow plotting the numerical values in the vector, itself? I have a feeling that it is the former, but I am not familar with image generation from greyscale pixels. Any guidance you could provide would be greatly appreciated.

Re: Classifying Handwritten Digits: 1 vs. 5

Thank you for your assistance. That helps me greatly.

 alanericy 10-15-2013 08:49 PM

Re: Classifying Handwritten Digits: 1 vs. 5

Quote:
 Originally Posted by magdon (Post 6325) 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.
Hi Professor, how to plot the separators with the training data if I use Logistic regression for classiﬁcation using gradient descent. In this way we could compute the probabilities for every point in the figure but how to plot a separator for them?

 magdon 10-16-2013 08:29 AM

Re: Classifying Handwritten Digits: 1 vs. 5

You can use the weights produced by logistic regression for classification.

Quote:
 Originally Posted by alanericy (Post 11571) Hi Professor, how to plot the separators with the training data if I use Logistic regression for classiﬁcation using gradient descent. In this way we could compute the probabilities for every point in the figure but how to plot a separator for them?

Re: Classifying Handwritten Digits: 1 vs. 5

Hello. I have a question about the digits assignment. Are we supposed to use two
features separately {1, feature i} or have a input vector consisting of {1,feature 1, feature 2}?

 alanericy 10-16-2013 01:36 PM

Re: Classifying Handwritten Digits: 1 vs. 5

Thanks for your reply. In the logistic regression will the separator still be linear or not? And should we use fixed or variable step size in the logistic regression?

 magdon 10-17-2013 11:46 AM

Re: Classifying Handwritten Digits: 1 vs. 5

{1,feature 1, feature 2}

Quote:
 Originally Posted by admas (Post 11573) Hello. I have a question about the digits assignment. Are we supposed to use two features separately {1, feature i} or have a input vector consisting of {1,feature 1, feature 2}?

 magdon 10-17-2013 11:47 AM

Re: Classifying Handwritten Digits: 1 vs. 5

The classification function is still which is linear. The weights are obtained using logistic regression.

Quote:
 Originally Posted by alanericy (Post 11574) Thanks for your reply. In the logistic regression will the separator still be linear or not? And should we use fixed or variable step size in the logistic regression?

All times are GMT -7. The time now is 10:34 PM.