use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class DOCTest method testDOCSimple.
/**
* Run DOC with fixed parameters and compare the result to a golden standard.
*/
@Test
public void testDOCSimple() {
Database db = makeSimpleDatabase(UNITTEST + "subspace-simple.csv", 600);
Clustering<?> result = //
new ELKIBuilder<DOC<DoubleVector>>(DOC.class).with(DOC.Parameterizer.RANDOM_ID, //
0).with(DOC.Parameterizer.ALPHA_ID, //
0.4).with(DOC.Parameterizer.BETA_ID, //
0.85).build().run(db);
testFMeasure(db, result, 1.0);
testClusterSizes(result, new int[] { 200, 400 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class P3CTest method testP3COverlapping.
/**
* Run P3C with fixed parameters and compare the result to a golden standard.
*/
@Test
public void testP3COverlapping() {
Database db = makeSimpleDatabase(UNITTEST + "subspace-overlapping-3-4d.ascii", 850);
Clustering<?> result = //
new ELKIBuilder<P3C<DoubleVector>>(P3C.class).with(P3C.Parameterizer.ALPHA_THRESHOLD_ID, //
0.01).build().run(db);
testFMeasure(db, result, .99596185);
testClusterSizes(result, new int[] { 4, 148, 300, 398 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class PreDeConTest method testPreDeConSubspaceOverlapping.
/**
* Run PreDeCon with fixed parameters and compare the result to a golden
* standard.O
*/
@Test
public void testPreDeConSubspaceOverlapping() {
Database db = makeSimpleDatabase(UNITTEST + "subspace-overlapping-3-4d.ascii", 850);
Clustering<Model> result = //
new ELKIBuilder<PreDeCon<DoubleVector>>(PreDeCon.class).with(DBSCAN.Parameterizer.EPSILON_ID, //
0.3).with(DBSCAN.Parameterizer.MINPTS_ID, //
10).with(PreDeCon.Settings.Parameterizer.DELTA_ID, //
0.012).with(PreDeCon.Settings.Parameterizer.KAPPA_ID, //
10.).with(PreDeCon.Settings.Parameterizer.LAMBDA_ID, //
2).build().run(db);
testFMeasure(db, result, 0.74982899);
testClusterSizes(result, new int[] { 356, 494 });
}
use of de.lmu.ifi.dbs.elki.database.Database 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);
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class CLIQUETest method testCLIQUEResults.
/**
* Run CLIQUE with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testCLIQUEResults() {
Database db = makeSimpleDatabase(UNITTEST + "subspace-simple.csv", 600);
Clustering<SubspaceModel> result = //
new ELKIBuilder<CLIQUE<DoubleVector>>(CLIQUE.class).with(CLIQUE.Parameterizer.TAU_ID, //
"0.1").with(CLIQUE.Parameterizer.XSI_ID, //
20).build().run(db);
// PairCounting is not appropriate here: overlapping clusterings!
// testFMeasure(db, result, 0.9882);
testClusterSizes(result, new int[] { 200, 200, 216, 400 });
}
Aggregations