mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeast...@apache.org
Subject svn commit: r651087 - in /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering: kmeans/KMeansDriver.java meanshift/MeanShiftCanopyJob.java
Date Wed, 23 Apr 2008 22:07:25 GMT
Author: jeastman
Date: Wed Apr 23 15:07:15 2008
New Revision: 651087

URL: http://svn.apache.org/viewvc?rev=651087&view=rev
Log:
MAHOUT-48 cleaned up isConverged methods.

All unit tests run.

- org.apache.mahout.clustering.kmeans.KMeansDriver.java
     (isConverged): removed unnecessary converged && and used simpler string test

           from MeanShiftCanopyJob that does not require decoding all clusters
     
- org.apache.mahout.clustering.meanshift.MeanShiftCanopyJob.java
     (isConverged): removed unnecessary converged && 
     
     

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java?rev=651087&r1=651086&r2=651087&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
Wed Apr 23 15:07:15 2008
@@ -179,9 +179,8 @@
     Text key = new Text();
     Text value = new Text();
     boolean converged = true;
-    while (reader.next(key, value)) {
-      Cluster cluster = Cluster.decodeCluster(value.toString());
-      converged = converged && cluster.isConverged();
+    while (converged && reader.next(key, value)) {
+      converged = value.toString().startsWith("V");
     }
     return converged;
   }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java?rev=651087&r1=651086&r2=651087&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyJob.java
Wed Apr 23 15:07:15 2008
@@ -101,7 +101,7 @@
     Text value = new Text();
     boolean converged = true;
     while (converged && reader.next(key, value))
-      converged = converged && value.toString().startsWith("V");
+      converged = value.toString().startsWith("V");
     return converged;
   }
 



Mime
View raw message