use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class SimplifiedHierarchyExtractionTest method testMiniMaxNNResults.
@Test
public void testMiniMaxNNResults() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Result result = //
new ELKIBuilder<>(SimplifiedHierarchyExtraction.class).with(SimplifiedHierarchyExtraction.Parameterizer.MINCLUSTERSIZE_ID, //
1).with(AbstractAlgorithm.ALGORITHM_ID, //
MiniMaxNNChain.class).build().run(db);
Clustering<?> clustering = findSingleClustering(result);
// minclustersize=1 is useless
testFMeasure(db, clustering, 0.0182169);
assertEquals(2 * 330 - 1, clustering.getAllClusters().size());
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class SimplifiedHierarchyExtractionTest method testSLINKDegenerate.
@Test
public void testSLINKDegenerate() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = //
new ELKIBuilder<>(SimplifiedHierarchyExtraction.class).with(SimplifiedHierarchyExtraction.Parameterizer.MINCLUSTERSIZE_ID, //
1).with(AbstractAlgorithm.ALGORITHM_ID, //
SLINK.class).build().run(db);
// minclustersize=1 is useless
testFMeasure(db, clustering, 0.0182169);
assertEquals(2 * 330 - 1, clustering.getAllClusters().size());
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class CLARATest method testCLARA.
/**
* Run CLARA with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testCLARA() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<MedoidModel> result = //
new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, //
5).with(CLARA.Parameterizer.RANDOM_ID, //
1).with(CLARA.Parameterizer.NUMSAMPLES_ID, //
2).with(CLARA.Parameterizer.SAMPLESIZE_ID, //
50).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class KMeansBisectingTest method testKMeansBisectingFMeasure.
/**
* Run KMeansBisecting with fixed parameters (k = 2) and compare f-measure to
* golden standard.
*/
@Test
public void testKMeansBisectingFMeasure() {
Database db = makeSimpleDatabase(UNITTEST + "bisecting-test.csv", 300);
KMeansBisecting<DoubleVector, MeanModel> kmeans = //
new ELKIBuilder<KMeansBisecting<DoubleVector, MeanModel>>(KMeansBisecting.class).with(KMeans.K_ID, //
2).with(KMeans.SEED_ID, //
0).with(BestOfMultipleKMeans.Parameterizer.TRIALS_ID, //
5).with(BestOfMultipleKMeans.Parameterizer.KMEANS_ID, //
KMeansLloyd.class).with(BestOfMultipleKMeans.Parameterizer.QUALITYMEASURE_ID, //
WithinClusterVarianceQualityMeasure.class).build();
// run KMedians on database
Clustering<MeanModel> result = kmeans.run(db);
testFMeasure(db, result, 0.7408);
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class KMeansElkanTest method testKMeansElkan.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testKMeansElkan() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<KMeansElkan<DoubleVector>>(KMeansElkan.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
Aggregations