use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class AnderbergHierarchicalClusteringTest method testMinimumVariance.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testMinimumVariance() {
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, //
AnderbergHierarchicalClustering.class).with(AGNES.Parameterizer.LINKAGE_ID, //
MinimumVarianceLinkage.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 AnderbergHierarchicalClusteringTest method testBetaVariance.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testBetaVariance() {
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, //
AnderbergHierarchicalClustering.class).with(AGNES.Parameterizer.LINKAGE_ID, //
FlexibleBetaLinkage.class).with(FlexibleBetaLinkage.Parameterizer.BETA_ID, //
-.33).build().run(db);
testFMeasure(db, clustering, 0.9277466);
testClusterSizes(clustering, new int[] { 196, 200, 242 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class AnderbergHierarchicalClusteringTest method testCompleteLink.
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testCompleteLink() {
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, //
AnderbergHierarchicalClustering.class).with(AGNES.Parameterizer.LINKAGE_ID, //
CompleteLinkage.class).build().run(db);
testFMeasure(db, clustering, 0.938167802);
testClusterSizes(clustering, new int[] { 200, 217, 221 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class MiniMaxNNChainTest 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, //
MiniMaxNNChain.class).build().run(db);
testFMeasure(db, clustering, 0.914592130);
testClusterSizes(clustering, new int[] { 59, 112, 159 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class MiniMaxNNChainTest 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, //
MiniMaxNNChain.class).build().run(db);
testFMeasure(db, clustering, 0.938662648);
testClusterSizes(clustering, new int[] { 200, 211, 227 });
}
Aggregations