CanopyDriver.run(conf, testdata, output, measure, 3.1, 1.1, true, true);
int numIterations = 2;
Path clustersIn = new Path(output, "clusters-0");
RepresentativePointsDriver.run(conf, clustersIn, new Path(output, "clusteredPoints"), output, measure, numIterations, false);
printRepPoints(numIterations);
ClusterEvaluator evaluatorMR = new ClusterEvaluator(conf, clustersIn);
// now run again using sequential reference point calculation
HadoopUtil.overwriteOutput(output);
CanopyDriver.run(conf, testdata, output, measure, 3.1, 1.1, true, true);
RepresentativePointsDriver.run(conf, clustersIn, new Path(output, "clusteredPoints"), output, measure, numIterations, true);
printRepPoints(numIterations);
ClusterEvaluator evaluatorSeq = new ClusterEvaluator(conf, clustersIn);
// compare results
assertEquals("InterCluster Density", evaluatorMR.interClusterDensity(), evaluatorSeq.interClusterDensity(), EPSILON);
assertEquals("IntraCluster Density", evaluatorMR.intraClusterDensity(), evaluatorSeq.intraClusterDensity(), EPSILON);
}