LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 1 (http://book.caltech.edu/bookforum/forumdisplay.php?f=130)
-   -   Detecting convergence for PLA (http://book.caltech.edu/bookforum/showthread.php?t=3839)

melipone 01-12-2013 02:25 PM

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?

yaser 01-12-2013 02:43 PM

Re: Detecting convergence for PLA
 
Quote:

Originally Posted by melipone (Post 8597)
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.

gah44 01-14-2013 01:55 PM

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.


All times are GMT -7. The time now is 12:52 AM.

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.