ClusteringTestUtils.writePointsToFile(referenceData, new Path(testdata, "file1"), fs, conf);
DistanceMeasure measure = new EuclideanDistanceMeasure();
initData(1, 0.75, measure);
ClusterEvaluator evaluator = new ClusterEvaluator(representativePoints, clusters, measure);
assertEquals("inter cluster density", 0.33333333333333315, evaluator.interClusterDensity(), EPSILON);
assertEquals("intra cluster density", 0.3656854249492381, evaluator.intraClusterDensity(), EPSILON);
}
@Test
public void testEmptyCluster() throws IOException {
ClusteringTestUtils.writePointsToFile(referenceData, new Path(testdata, "file1"), fs, conf);