use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class MiniMaxTest method testMiniMax.
// TODO: add more data sets.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testMiniMax() {
Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
Clustering<?> clustering = //
new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class).with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, //
3).with(AbstractAlgorithm.ALGORITHM_ID, //
MiniMax.class).build().run(db);
testFMeasure(db, clustering, 0.938662648);
testClusterSizes(clustering, new int[] { 200, 211, 227 });
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class MiniMaxTest method testMiniMax2.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testMiniMax2() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = //
new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class).with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, //
3).with(AbstractAlgorithm.ALGORITHM_ID, //
MiniMax.class).build().run(db);
testFMeasure(db, clustering, 0.914592130);
testClusterSizes(clustering, new int[] { 59, 112, 159 });
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class CutDendrogramByHeightTest method testSLINKResults.
@Test
public void testSLINKResults() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = //
new ELKIBuilder<>(CutDendrogramByHeight.class).with(CutDendrogramByHeight.Parameterizer.THRESHOLD_ID, //
0.14).with(AbstractAlgorithm.ALGORITHM_ID, //
SLINK.class).build().run(db);
testFMeasure(db, clustering, 0.9474250948);
testClusterSizes(clustering, new int[] { 1, 1, 1, 1, 1, 2, 3, 62, 104, 154 });
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class HDBSCANHierarchyExtractionTest method testHDBSCANResults.
@Test
public void testHDBSCANResults() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
HDBSCANHierarchyExtraction slink = //
new ELKIBuilder<>(HDBSCANHierarchyExtraction.class).with(HDBSCANHierarchyExtraction.Parameterizer.MINCLUSTERSIZE_ID, //
50).with(AbstractAlgorithm.ALGORITHM_ID, //
HDBSCANLinearMemory.class).with(HDBSCANLinearMemory.Parameterizer.MIN_PTS_ID, //
20).build();
testFMeasure(db, slink.run(db), 0.97218);
testClusterSizes(slink.run(db), new int[] { 21, 54, 103, 152 });
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class CLARANSTest method testCLARANSNoise.
@Test
public void testCLARANSNoise() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<MedoidModel> result = //
new ELKIBuilder<CLARANS<DoubleVector>>(CLARANS.class).with(KMeans.K_ID, //
3).with(CLARANS.Parameterizer.RANDOM_ID, //
0).with(CLARANS.Parameterizer.NEIGHBORS_ID, //
.1).with(CLARANS.Parameterizer.RESTARTS_ID, //
5).build().run(db);
testFMeasure(db, result, 0.913858);
testClusterSizes(result, new int[] { 57, 115, 158 });
}
Aggregations