use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class NNChainTest method testGroupAverage.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testGroupAverage() {
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, //
NNChain.class).with(AGNES.Parameterizer.LINKAGE_ID, //
GroupAverageLinkage.class).build().run(db);
testFMeasure(db, clustering, 0.93866265);
testClusterSizes(clustering, new int[] { 200, 211, 227 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class ClustersWithNoiseExtractionTest method testClustering.
@Test
public void testClustering() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = //
new ELKIBuilder<>(ClustersWithNoiseExtraction.class).with(ClustersWithNoiseExtraction.Parameterizer.K_ID, //
3).with(ClustersWithNoiseExtraction.Parameterizer.MINCLUSTERSIZE_ID, //
5).with(AbstractAlgorithm.ALGORITHM_ID, //
AnderbergHierarchicalClustering.class).build().run(db);
testFMeasure(db, clustering, 0.9242);
testClusterSizes(clustering, new int[] { 56, 123, 151 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class CutDendrogramByNumberOfClustersTest method testSLINKHierarchical.
@Test
public void testSLINKHierarchical() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = //
new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class).with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, //
10).with(//
CutDendrogramByNumberOfClusters.Parameterizer.HIERARCHICAL_ID).with(AbstractAlgorithm.ALGORITHM_ID, //
SLINK.class).build().run(db);
testFMeasure(db, clustering, 0.9474250948);
testClusterSizes(clustering, new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3, 62, 104, 154 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class SimplifiedHierarchyExtractionTest method testHDBSCANResults.
@Test
public void testHDBSCANResults() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Result result = //
new ELKIBuilder<>(SimplifiedHierarchyExtraction.class).with(SimplifiedHierarchyExtraction.Parameterizer.MINCLUSTERSIZE_ID, //
50).with(AbstractAlgorithm.ALGORITHM_ID, //
HDBSCANLinearMemory.class).with(HDBSCANLinearMemory.Parameterizer.MIN_PTS_ID, //
20).build().run(db);
Clustering<?> clustering = findSingleClustering(result);
testFMeasure(db, clustering, 0.96941);
testClusterSizes(clustering, new int[] { 7, 14, 54, 103, 152 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class SimplifiedHierarchyExtractionTest method testHDBSCANDegenerate.
@Test
public void testHDBSCANDegenerate() {
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, //
HDBSCANLinearMemory.class).with(HDBSCANLinearMemory.Parameterizer.MIN_PTS_ID, //
20).build().run(db);
Clustering<?> clustering = findSingleClustering(result);
// minclustersize=1 is useless
testFMeasure(db, clustering, 0.0182169);
assertEquals(2 * 330 - 1, clustering.getAllClusters().size());
}
Aggregations