use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.CLARA in project elki by elki-project.
the class FirstKInitialMeansTest method testFirstKInitialMedoids.
/**
* Run CLARA with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testFirstKInitialMedoids() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, //
5).with(KMeans.INIT_ID, //
FirstKInitialMeans.class).with(KMeans.MAXITER_ID, //
1).with(CLARA.Parameterizer.SAMPLESIZE_ID, //
10).with(CLARA.Parameterizer.RANDOM_ID, //
0).build().run(db);
testFMeasure(db, result, 0.7454859);
testClusterSizes(result, new int[] { 45, 155, 200, 287, 313 });
}
use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.CLARA in project elki by elki-project.
the class PAMInitialMeansTest method testPAMInitialMedoids.
/**
* Run CLARA with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testPAMInitialMedoids() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, //
5).with(KMeans.INIT_ID, //
PAMInitialMeans.class).with(KMeans.MAXITER_ID, //
1).with(CLARA.Parameterizer.SAMPLESIZE_ID, //
10).with(CLARA.Parameterizer.RANDOM_ID, //
0).build().run(db);
testFMeasure(db, result, 0.99602);
testClusterSizes(result, new int[] { 198, 200, 200, 200, 202 });
}
Aggregations