int numIterations = 2;
Path clustersIn = new Path(output, "clusters-0-final");
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.delete(conf, output);
CanopyDriver.run(conf, testdata, output, measure, 3.1, 1.1, true, 0.0, 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);
}