LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 1

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2013, 02:25 PM
melipone melipone is offline
Senior Member
 
Join Date: Jan 2013
Posts: 72
Default Detecting convergence for PLA

What's the best way to detect convergence for PLA? Check whether there is no misclassified examples in 1 iteration or Pr(f(x) != g(x)) does not change?
Reply With Quote
  #2  
Old 01-12-2013, 02:43 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Detecting convergence for PLA

Quote:
Originally Posted by melipone View Post
What's the best way to detect convergence for PLA? Check whether there is no misclassified examples in 1 iteration or Pr(f(x) != g(x)) does not change?
Checking that there are no misclassified examples in the training data, which would naturally happen as you look for a misclassfied point for the next PLA iteration.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 01-14-2013, 01:55 PM
gah44 gah44 is offline
Invited Guest
 
Join Date: Jul 2012
Location: Seattle, WA
Posts: 153
Default Re: Detecting convergence for PLA

Since it takes longer to check for misclassified points than to do the update, what I do is actually:

Loop up to 10000 times:
Choose a random point.
If misclassified, update it and count the update.
Every 20 such tries, test for no more misclassified points and exit loop.

The 10000 avoids infinite loops due to mistakes in the algorithm.

My first PLA was in AWK, which is pretty slow.

I now have PLA in Java, which is plenty fast no matter how you do it.

Any number besides 20 will also work, that was my guess as a balance between the update time and testing time.
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 08:22 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.