You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by pr...@apache.org on 2012/03/16 22:07:23 UTC
svn commit: r1301761 - in /mahout/trunk:
core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java
integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
Author: pranjan
Date: Fri Mar 16 21:07:22 2012
New Revision: 1301761
URL: http://svn.apache.org/viewvc?rev=1301761&view=rev
Log:
MAHOUT-981, MAHOUT-983. Fixing test cases which fail intermittently.
Build is passing on my machine ( even for the last commit ).
Tried to identify all test cases, which can fail intermittently and fixed them.
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java
mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
Modified: mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java?rev=1301761&r1=1301760&r2=1301761&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java Fri Mar 16 21:07:22 2012
@@ -525,11 +525,12 @@ public final class TestKmeansClustering
assertEquals("got unexpected number of centers", 2, count);
// now run the KMeans job
- KMeansDriver.run(pointsPath, new Path(outputPath, "clusters-0-final"), outputPath, new EuclideanDistanceMeasure(),
+ Path kmeansOutput = new Path(outputPath, "kmeans");
+ KMeansDriver.run(pointsPath, new Path(outputPath, "clusters-0-final"), kmeansOutput, new EuclideanDistanceMeasure(),
0.001, 10, true, false);
// now compare the expected clusters with actual
- Path clusteredPointsPath = new Path(outputPath, "clusteredPoints");
+ Path clusteredPointsPath = new Path(kmeansOutput, "clusteredPoints");
DummyOutputCollector<IntWritable,WeightedVectorWritable> collector = new DummyOutputCollector<IntWritable,WeightedVectorWritable>();
// The key is the clusterId, the value is the weighted vector
Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java?rev=1301761&r1=1301760&r2=1301761&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java Fri Mar 16 21:07:22 2012
@@ -336,11 +336,12 @@ public final class TestClusterDumper ext
// now run the Canopy job to prime kMeans canopies
CanopyDriver.run(conf, svdData, output, measure, 8, 4, false, 0.0, true);
// now run the KMeans job
- KMeansDriver.run(svdData, new Path(output, "clusters-0"), output, measure,
+ Path kmeansOutput = new Path(output, "kmeans");
+ KMeansDriver.run(svdData, new Path(output, "clusters-0"), kmeansOutput, measure,
0.001, 10, true, true);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(finalClusterPath(conf,
- output, 10), new Path(output, "clusteredPoints"));
+ kmeansOutput, 10), new Path(kmeansOutput, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
@@ -377,11 +378,12 @@ public final class TestClusterDumper ext
CanopyDriver.run(conf, sData.getRowPath(), output, measure, 8, 4, false,
0.0, true);
// now run the KMeans job
- KMeansDriver.run(sData.getRowPath(), new Path(output, "clusters-0"),
- output, measure, 0.001, 10, true, true);
+ Path kmeansOutput = new Path(output, "kmeans");
+ KMeansDriver.run(sData.getRowPath(), new Path(output, "clusters-0"),
+ kmeansOutput, measure, 0.001, 10, true, true);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(finalClusterPath(conf,
- output, 10), new Path(output, "clusteredPoints"));
+ kmeansOutput, 10), new Path(kmeansOutput, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
@@ -421,11 +423,12 @@ public final class TestClusterDumper ext
CanopyDriver.run(conf, sData.getRowPath(), output, measure, 8, 4, false,
0.0, true);
// now run the KMeans job
- KMeansDriver.run(sData.getRowPath(), new Path(output, "clusters-0"),
- output, measure, 0.001, 10, true, true);
+ Path kmeansOutput = new Path(output, "kmeans");
+ KMeansDriver.run(sData.getRowPath(), new Path(output, "clusters-0"),
+ kmeansOutput, measure, 0.001, 10, true, true);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(finalClusterPath(conf,
- output, 10), new Path(output, "clusteredPoints"));
+ kmeansOutput, 10), new Path(kmeansOutput, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
}