mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robina...@apache.org
Subject svn commit: r907217 - in /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering: fuzzykmeans/FuzzyKMeansReducer.java kmeans/KMeansReducer.java
Date Sat, 06 Feb 2010 13:56:32 GMT
Author: robinanil
Date: Sat Feb  6 13:56:31 2010
New Revision: 907217

URL: http://svn.apache.org/viewvc?rev=907217&view=rev
Log:
Report number of converged clusters for kmeans and fuzzy kmeans, as a feedback to the user

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java?rev=907217&r1=907216&r2=907217&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
Sat Feb  6 13:56:31 2010
@@ -55,7 +55,10 @@
 
     }
     // force convergence calculation
-    clusterer.computeConvergence(cluster);
+    boolean converged = clusterer.computeConvergence(cluster);
+    if (converged) {
+      reporter.incrCounter("Clustering", "Converged Clusters", 1);
+    }
     output.collect(new Text(cluster.getIdentifier()), cluster);
   }
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java?rev=907217&r1=907216&r2=907217&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
Sat Feb  6 13:56:31 2010
@@ -48,7 +48,10 @@
       cluster.addPoints(delta.getPoints(), delta.getPointTotal());
     }
     // force convergence calculation
-    cluster.computeConvergence(this.measure, this.convergenceDelta);
+    boolean converged = cluster.computeConvergence(this.measure, this.convergenceDelta);
+    if (converged) {
+      reporter.incrCounter("Clustering", "Converged Clusters", 1);
+    }
     output.collect(new Text(cluster.getIdentifier()), cluster);
   }
 



Mime
View raw message