use of de.lmu.ifi.dbs.elki.algorithm.clustering.trivial.TrivialAllNoise in project elki by elki-project.
the class ClusterContingencyTableTest method testCompareDatabases.
/**
* Validate {@link ClusterContingencyTable} with respect to its ability to
* compare data clusterings.
*/
@Test
public void testCompareDatabases() {
Database db = AbstractSimpleAlgorithmTest.makeSimpleDatabase(dataset, shoulds);
Clustering<Model> rai = new TrivialAllInOne().run(db);
Clustering<Model> ran = new TrivialAllNoise().run(db);
Clustering<?> rbl = new ByLabelClustering().run(db);
assertEquals(1.0, computeFMeasure(rai, rai, false), Double.MIN_VALUE);
assertEquals(1.0, computeFMeasure(ran, ran, false), Double.MIN_VALUE);
assertEquals(1.0, computeFMeasure(rbl, rbl, false), Double.MIN_VALUE);
assertEquals(0.009950248756218905, computeFMeasure(ran, rbl, true), Double.MIN_VALUE);
assertEquals(0.0033277870216306157, computeFMeasure(rai, ran, true), Double.MIN_VALUE);
assertEquals(0.5, /* 0.3834296724470135 */
computeFMeasure(rai, rbl, false), Double.MIN_VALUE);
}
Aggregations