LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #11  
Old 10-13-2012, 06:15 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

This thread has a response that might help:

http://book.caltech.edu/bookforum/showthread.php?t=2101


Quote:
Originally Posted by rpistu View Post
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?
__________________
Have faith in probability
Reply With Quote
  #12  
Old 10-03-2013, 08:00 PM
admas admas is offline
Junior Member
 
Join Date: Oct 2013
Posts: 3
Default 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.
Reply With Quote
  #13  
Old 10-04-2013, 09:58 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

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 View Post
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.
__________________
Have faith in probability
Reply With Quote
  #14  
Old 10-05-2013, 04:13 PM
admas admas is offline
Junior Member
 
Join Date: Oct 2013
Posts: 3
Default Re: Classifying Handwritten Digits: 1 vs. 5

Thank you for your assistance. That helps me greatly.
Reply With Quote
  #15  
Old 10-15-2013, 08:49 PM
alanericy alanericy is offline
Junior Member
 
Join Date: Oct 2013
Posts: 5
Default Re: Classifying Handwritten Digits: 1 vs. 5

Quote:
Originally Posted by magdon View Post
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 classification 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?
Reply With Quote
  #16  
Old 10-16-2013, 08:29 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

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

Quote:
Originally Posted by alanericy View Post
Hi Professor, how to plot the separators with the training data if I use Logistic regression for classification 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?
__________________
Have faith in probability
Reply With Quote
  #17  
Old 10-16-2013, 10:09 AM
admas admas is offline
Junior Member
 
Join Date: Oct 2013
Posts: 3
Default 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}?
Reply With Quote
  #18  
Old 10-16-2013, 01:36 PM
alanericy alanericy is offline
Junior Member
 
Join Date: Oct 2013
Posts: 5
Default 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?
Reply With Quote
  #19  
Old 10-17-2013, 11:46 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

{1,feature 1, feature 2}

Quote:
Originally Posted by admas View Post
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}?
__________________
Have faith in probability
Reply With Quote
  #20  
Old 10-17-2013, 11:47 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

The classification function is still sign(w^Tx) which is linear. The weights w are obtained using logistic regression.

Quote:
Originally Posted by alanericy View Post
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?
__________________
Have faith in probability
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 12:02 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.