You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by je...@apache.org on 2010/07/22 21:25:21 UTC
svn commit: r966816 [2/2] - in /mahout/trunk:
core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/
core/src/main/java/org/apache/mahout/clustering/kmeans/
core/src/main/java/org/apache/mahout/clustering/meanshift/
core/src/test/java/org/apache/...
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=966816&r1=966815&r2=966816&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 Thu Jul 22 19:25:20 2010
@@ -351,6 +351,61 @@ public class TestKmeansClustering extend
}
/** Story: User wishes to run kmeans job on reference data */
+ public void testKMeansSeqJob() throws Exception {
+ List<VectorWritable> points = getPointsWritable(reference);
+
+ Path pointsPath = getTestTempDirPath("points");
+ Path clustersPath = getTestTempDirPath("clusters");
+ Configuration conf = new Configuration();
+ ClusteringTestUtils.writePointsToFile(points, new Path(pointsPath, "file1"), fs, conf);
+ ClusteringTestUtils.writePointsToFile(points, new Path(pointsPath, "file2"), fs, conf);
+ for (int k = 1; k < points.size(); k++) {
+ System.out.println("testKMeansMRJob k= " + k);
+ // pick k initial cluster centers at random
+ Path path = new Path(clustersPath, "part-00000");
+ FileSystem fs = FileSystem.get(path.toUri(), conf);
+ SequenceFile.Writer writer = new SequenceFile.Writer(fs, conf, path, Text.class, Cluster.class);
+
+ for (int i = 0; i < k + 1; i++) {
+ Vector vec = points.get(i).get();
+
+ Cluster cluster = new Cluster(vec, i);
+ // add the center so the centroid will be correct upon output
+ cluster.addPoint(cluster.getCenter());
+ writer.append(new Text(cluster.getIdentifier()), cluster);
+ }
+ writer.close();
+ // now run the Job
+ Path outputPath = getTestTempDirPath("output");
+ //KMeansDriver.runJob(pointsPath, clustersPath, outputPath, EuclideanDistanceMeasure.class.getName(), 0.001, 10, k + 1, true);
+ String[] args = { optKey(DefaultOptionCreator.INPUT_OPTION), pointsPath.toString(),
+ optKey(DefaultOptionCreator.CLUSTERS_IN_OPTION), clustersPath.toString(), optKey(DefaultOptionCreator.OUTPUT_OPTION),
+ outputPath.toString(), optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION), EuclideanDistanceMeasure.class.getName(),
+ optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.001", optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "2",
+ optKey(DefaultOptionCreator.CLUSTERING_OPTION), optKey(DefaultOptionCreator.OVERWRITE_OPTION),
+ optKey(DefaultOptionCreator.METHOD_OPTION), DefaultOptionCreator.SEQUENTIAL_METHOD };
+ new KMeansDriver().run(args);
+
+ // now compare the expected clusters with actual
+ Path clusteredPointsPath = new Path(outputPath, "clusteredPoints");
+ SequenceFile.Reader reader = new SequenceFile.Reader(fs, new Path(clusteredPointsPath, "part-m-0"), conf);
+ int[] expect = expectedNumPoints[k];
+ DummyOutputCollector<IntWritable, WeightedVectorWritable> collector = new DummyOutputCollector<IntWritable, WeightedVectorWritable>();
+ // The key is the clusterId
+ IntWritable clusterId = new IntWritable(0);
+ // The value is the weighted vector
+ WeightedVectorWritable value = new WeightedVectorWritable();
+ while (reader.next(clusterId, value)) {
+ collector.collect(clusterId, value);
+ clusterId = new IntWritable(0);
+ value = new WeightedVectorWritable();
+ }
+ reader.close();
+ assertEquals("clusters[" + k + ']', expect.length, collector.getKeys().size());
+ }
+ }
+
+ /** Story: User wishes to run kmeans job on reference data */
public void testKMeansMRJob() throws Exception {
List<VectorWritable> points = getPointsWritable(reference);
@@ -378,15 +433,11 @@ public class TestKmeansClustering extend
// now run the Job
Path outputPath = getTestTempDirPath("output");
//KMeansDriver.runJob(pointsPath, clustersPath, outputPath, EuclideanDistanceMeasure.class.getName(), 0.001, 10, k + 1, true);
- String[] args = {
- optKey(DefaultOptionCreator.INPUT_OPTION), pointsPath.toString(),
- optKey(DefaultOptionCreator.CLUSTERS_IN_OPTION), clustersPath.toString(),
- optKey(DefaultOptionCreator.OUTPUT_OPTION), outputPath.toString(),
- optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION), EuclideanDistanceMeasure.class.getName(),
- optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.001",
- optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "2",
- optKey(DefaultOptionCreator.CLUSTERING_OPTION),
- optKey(DefaultOptionCreator.OVERWRITE_OPTION) };
+ String[] args = { optKey(DefaultOptionCreator.INPUT_OPTION), pointsPath.toString(),
+ optKey(DefaultOptionCreator.CLUSTERS_IN_OPTION), clustersPath.toString(), optKey(DefaultOptionCreator.OUTPUT_OPTION),
+ outputPath.toString(), optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION), EuclideanDistanceMeasure.class.getName(),
+ optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.001", optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "2",
+ optKey(DefaultOptionCreator.CLUSTERING_OPTION), optKey(DefaultOptionCreator.OVERWRITE_OPTION) };
new KMeansDriver().run(args);
// now compare the expected clusters with actual
@@ -435,7 +486,8 @@ public class TestKmeansClustering extend
0.001,
10,
1,
- true);
+ true,
+ false);
// now compare the expected clusters with actual
Path clusteredPointsPath = new Path(outputPath, "clusteredPoints");
Modified: mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java Thu Jul 22 19:25:20 2010
@@ -312,16 +312,12 @@ public class TestMeanShift extends Mahou
// now run the Job using the run() command. Other tests can continue to use runJob().
Path output = getTestTempDirPath("output");
//MeanShiftCanopyDriver.runJob(input, output, EuclideanDistanceMeasure.class.getName(), 4, 1, 0.5, 10, false, false);
- String[] args = {
- optKey(DefaultOptionCreator.INPUT_OPTION), getTestTempDirPath("testdata").toString(),
- optKey(DefaultOptionCreator.OUTPUT_OPTION), output.toString(),
- optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION), EuclideanDistanceMeasure.class.getName(),
- optKey(DefaultOptionCreator.T1_OPTION), "4",
- optKey(DefaultOptionCreator.T2_OPTION), "1",
- optKey(DefaultOptionCreator.CLUSTERING_OPTION),
- optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "4",
- optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.5",
- optKey(DefaultOptionCreator.OVERWRITE_OPTION) };
+ String[] args = { optKey(DefaultOptionCreator.INPUT_OPTION), getTestTempDirPath("testdata").toString(),
+ optKey(DefaultOptionCreator.OUTPUT_OPTION), output.toString(), optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION),
+ EuclideanDistanceMeasure.class.getName(), optKey(DefaultOptionCreator.T1_OPTION), "4",
+ optKey(DefaultOptionCreator.T2_OPTION), "1", optKey(DefaultOptionCreator.CLUSTERING_OPTION),
+ optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "4", optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.5",
+ optKey(DefaultOptionCreator.OVERWRITE_OPTION) };
new MeanShiftCanopyDriver().run(args);
Path outPart = new Path(output, "clusters-3/part-r-00000");
SequenceFile.Reader reader = new SequenceFile.Reader(fs, outPart, conf);
@@ -334,4 +330,42 @@ public class TestMeanShift extends Mahou
reader.close();
assertEquals("count", 3, count);
}
+
+ /**
+ * Story: User can produce final point clustering using a Hadoop map/reduce job and a
+ * EuclideanDistanceMeasure.
+ */
+ public void testCanopyEuclideanSeqJob() throws Exception {
+ Path input = getTestTempDirPath("testdata");
+ Configuration conf = new Configuration();
+ FileSystem fs = FileSystem.get(input.toUri(), conf);
+ List<VectorWritable> points = new ArrayList<VectorWritable>();
+ for (Vector v : raw) {
+ points.add(new VectorWritable(v));
+ }
+ ClusteringTestUtils.writePointsToFile(points, getTestTempFilePath("testdata/file1"), fs, conf);
+ ClusteringTestUtils.writePointsToFile(points, getTestTempFilePath("testdata/file2"), fs, conf);
+ // now run the Job using the run() command. Other tests can continue to use runJob().
+ Path output = getTestTempDirPath("output");
+ System.out.println("Output Path: " + output.toString());
+ //MeanShiftCanopyDriver.runJob(input, output, EuclideanDistanceMeasure.class.getName(), 4, 1, 0.5, 10, false, false);
+ String[] args = { optKey(DefaultOptionCreator.INPUT_OPTION), getTestTempDirPath("testdata").toString(),
+ optKey(DefaultOptionCreator.OUTPUT_OPTION), output.toString(), optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION),
+ EuclideanDistanceMeasure.class.getName(), optKey(DefaultOptionCreator.T1_OPTION), "4",
+ optKey(DefaultOptionCreator.T2_OPTION), "1", optKey(DefaultOptionCreator.CLUSTERING_OPTION),
+ optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION), "4", optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION), "0.5",
+ optKey(DefaultOptionCreator.OVERWRITE_OPTION), optKey(DefaultOptionCreator.METHOD_OPTION),
+ DefaultOptionCreator.SEQUENTIAL_METHOD };
+ new MeanShiftCanopyDriver().run(args);
+ Path outPart = new Path(output, "clusters-4/part-r-00000");
+ SequenceFile.Reader reader = new SequenceFile.Reader(fs, outPart, conf);
+ Text key = new Text();
+ MeanShiftCanopy value = new MeanShiftCanopy();
+ int count = 0;
+ while (reader.next(key, value)) {
+ count++;
+ }
+ reader.close();
+ assertEquals("count", 5, count);
+ }
}
Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/fuzzykmeans/Job.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/fuzzykmeans/Job.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/fuzzykmeans/Job.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/fuzzykmeans/Job.java Thu Jul 22 19:25:20 2010
@@ -182,7 +182,8 @@ public final class Job extends FuzzyKMea
fuzziness,
true,
true,
- 0.0);
+ 0.0,
+ false);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-3"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(null);
Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/kmeans/Job.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/kmeans/Job.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/kmeans/Job.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/kmeans/Job.java Thu Jul 22 19:25:20 2010
@@ -96,7 +96,7 @@ public final class Job extends KMeansDri
.get(DefaultOptionCreator.NUM_CLUSTERS_OPTION)));
}
boolean runClustering = hasOption(DefaultOptionCreator.CLUSTERING_OPTION);
- runJob(input, clusters, output, measureClass, convergenceDelta, maxIterations, numReduceTasks, runClustering);
+ runJob(input, clusters, output, measureClass, convergenceDelta, maxIterations, numReduceTasks, runClustering, false);
return 0;
}
@@ -144,7 +144,7 @@ public final class Job extends KMeansDri
convergenceDelta,
maxIterations,
1,
- true);
+ true, false);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-" + maxIterations), new Path(output,
"clusteredPoints"));
Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/Job.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/Job.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/Job.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/Job.java Thu Jul 22 19:25:20 2010
@@ -87,7 +87,7 @@ public final class Job extends MeanShift
int maxIterations = Integer.parseInt(getOption(DefaultOptionCreator.MAX_ITERATIONS_OPTION));
boolean inputIsCanopies = hasOption(INPUT_IS_CANOPIES_OPTION);
- runJob(input, output, measureClass, t1, t2, convergenceDelta, maxIterations, inputIsCanopies, runClustering);
+ runJob(input, output, measureClass, t1, t2, convergenceDelta, maxIterations, inputIsCanopies, runClustering, false);
return 0;
}
@@ -137,7 +137,7 @@ public final class Job extends MeanShift
convergenceDelta,
maxIterations,
true,
- true);
+ true, false);
// run ClusterDumper
ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-" + maxIterations), new Path(output,
"clusteredPoints"));
Modified: mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java (original)
+++ mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java Thu Jul 22 19:25:20 2010
@@ -84,8 +84,10 @@ public class TestClusterDumper extends M
private void getSampleData(String[] docs2) throws IOException {
sampleData = new ArrayList<VectorWritable>();
RAMDirectory directory = new RAMDirectory();
- IndexWriter writer = new IndexWriter(directory, new StandardAnalyzer(Version.LUCENE_CURRENT), true,
- IndexWriter.MaxFieldLength.UNLIMITED);
+ IndexWriter writer = new IndexWriter(directory,
+ new StandardAnalyzer(Version.LUCENE_CURRENT),
+ true,
+ IndexWriter.MaxFieldLength.UNLIMITED);
for (int i = 0; i < docs2.length; i++) {
Document doc = new Document();
Field id = new Field("id", "doc_" + i, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS);
@@ -120,9 +122,9 @@ public class TestClusterDumper extends M
for (Vector vector : iterable) {
Assert.assertNotNull(vector);
NamedVector namedVector;
- if (vector instanceof NamedVector){
+ if (vector instanceof NamedVector) {
//rename it for testing purposes
- namedVector = new NamedVector(((NamedVector)vector).getDelegate(), "P(" + i + ')');
+ namedVector = new NamedVector(((NamedVector) vector).getDelegate(), "P(" + i + ')');
} else {
namedVector = new NamedVector(vector, "P(" + i + ')');
@@ -135,62 +137,59 @@ public class TestClusterDumper extends M
public void testCanopy() throws Exception { // now run the Job
Path output = getTestTempDirPath("output");
- CanopyDriver.runJob(getTestTempDirPath("testdata"), output,
- EuclideanDistanceMeasure.class.getName(), 8, 4, true, false);
+ CanopyDriver.runJob(getTestTempDirPath("testdata"), output, EuclideanDistanceMeasure.class.getName(), 8, 4, true, false);
// run ClusterDumper
- ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-0"),
- new Path(output, "clusteredPoints"));
+ ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-0"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
public void testKmeans() throws Exception {
// now run the Canopy job to prime kMeans canopies
Path output = getTestTempDirPath("output");
- CanopyDriver.runJob(getTestTempDirPath("testdata"), output,
- EuclideanDistanceMeasure.class.getName(), 8, 4, false, false);
+ CanopyDriver.runJob(getTestTempDirPath("testdata"), output, EuclideanDistanceMeasure.class.getName(), 8, 4, false, false);
// now run the KMeans job
- KMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output,
- EuclideanDistanceMeasure.class.getName(), 0.001, 10, 1, true);
+ KMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output, EuclideanDistanceMeasure.class
+ .getName(), 0.001, 10, 1, true, false);
// run ClusterDumper
- ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-2"),
- new Path(output, "clusteredPoints"));
+ ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-2"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
public void testFuzzyKmeans() throws Exception {
// now run the Canopy job to prime kMeans canopies
Path output = getTestTempDirPath("output");
- CanopyDriver.runJob(getTestTempDirPath("testdata"), output,
- EuclideanDistanceMeasure.class.getName(), 8, 4, false, false);
+ CanopyDriver.runJob(getTestTempDirPath("testdata"), output, EuclideanDistanceMeasure.class.getName(), 8, 4, false, false);
// now run the Fuzzy KMeans job
- FuzzyKMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output,
- EuclideanDistanceMeasure.class.getName(), 0.001, 10,
- 1, (float) 1.1, true, true, 0);
+ FuzzyKMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output, EuclideanDistanceMeasure.class
+ .getName(), 0.001, 10, 1, (float) 1.1, true, true, 0, false);
// run ClusterDumper
- ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-3"),
- new Path(output, "clusteredPoints"));
+ ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-3"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
public void testMeanShift() throws Exception {
Path output = getTestTempDirPath("output");
- MeanShiftCanopyDriver.runJob(getTestTempDirPath("testdata"), output,
- CosineDistanceMeasure.class.getName(), 0.5, 0.01, 0.05, 10, false, true);
+ MeanShiftCanopyDriver.runJob(getTestTempDirPath("testdata"),
+ output,
+ CosineDistanceMeasure.class.getName(),
+ 0.5,
+ 0.01,
+ 0.05,
+ 10,
+ false,
+ true, false);
// run ClusterDumper
- ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-1"),
- new Path(output, "clusteredPoints"));
+ ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-1"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
public void testDirichlet() throws Exception {
Path output = getTestTempDirPath("output");
NamedVector prototype = (NamedVector) sampleData.get(0).get();
- DirichletDriver.runJob(getTestTempDirPath("testdata"), output,
- L1ModelDistribution.class.getName(), prototype.getDelegate().getClass().getName(),
- 15, 10, 1.0, 1, true, true, 0, false);
+ DirichletDriver.runJob(getTestTempDirPath("testdata"), output, L1ModelDistribution.class.getName(), prototype.getDelegate()
+ .getClass().getName(), 15, 10, 1.0, 1, true, true, 0, false);
// run ClusterDumper
- ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-10"),
- new Path(output, "clusteredPoints"));
+ ClusterDumper clusterDumper = new ClusterDumper(new Path(output, "clusters-10"), new Path(output, "clusteredPoints"));
clusterDumper.printClusters(termDictionary);
}
}
Modified: mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java?rev=966816&r1=966815&r2=966816&view=diff
==============================================================================
--- mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java (original)
+++ mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java Thu Jul 22 19:25:20 2010
@@ -154,7 +154,7 @@ public class TestCDbwEvaluator extends M
// now run the KMeans job
Path output = getTestTempDirPath("output");
KMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output,
- EuclideanDistanceMeasure.class.getName(), 0.001, 10, 1, true);
+ EuclideanDistanceMeasure.class.getName(), 0.001, 10, 1, true, false);
int numIterations = 2;
CDbwDriver.runJob(new Path(output, "clusters-2"), new Path(output, "clusteredPoints"), output,
EuclideanDistanceMeasure.class.getName(), numIterations, 1);
@@ -168,7 +168,7 @@ public class TestCDbwEvaluator extends M
// now run the KMeans job
Path output = getTestTempDirPath("output");
FuzzyKMeansDriver.runJob(getTestTempDirPath("testdata"), new Path(output, "clusters-0"), output,
- EuclideanDistanceMeasure.class.getName(), 0.001, 10, 1, 2, true, true, 0);
+ EuclideanDistanceMeasure.class.getName(), 0.001, 10, 1, 2, true, true, 0, false);
int numIterations = 2;
CDbwDriver.runJob(new Path(output, "clusters-4"), new Path(output, "clusteredPoints"), output,
EuclideanDistanceMeasure.class.getName(), numIterations, 1);
@@ -177,7 +177,7 @@ public class TestCDbwEvaluator extends M
public void testMeanShift() throws Exception {
MeanShiftCanopyDriver.runJob(getTestTempDirPath("testdata"), getTestTempDirPath("output"),
- EuclideanDistanceMeasure.class.getName(), 2.1, 1.0, 0.001, 10, false, true);
+ EuclideanDistanceMeasure.class.getName(), 2.1, 1.0, 0.001, 10, false, true, false);
int numIterations = 2;
Path output = getTestTempDirPath("output");
CDbwDriver.runJob(new Path(output, "clusters-2"), new Path(output, "clusteredPoints"), output,