Search in sources :

Example 76 with Database

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 });
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 77 with Database

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 });
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 78 with Database

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 });
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) Model(de.lmu.ifi.dbs.elki.data.model.Model) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 79 with Database

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);
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) Model(de.lmu.ifi.dbs.elki.data.model.Model) TrivialAllNoise(de.lmu.ifi.dbs.elki.algorithm.clustering.trivial.TrivialAllNoise) TrivialAllInOne(de.lmu.ifi.dbs.elki.algorithm.clustering.trivial.TrivialAllInOne) ByLabelClustering(de.lmu.ifi.dbs.elki.algorithm.clustering.trivial.ByLabelClustering) Test(org.junit.Test) AbstractSimpleAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.AbstractSimpleAlgorithmTest)

Example 80 with Database

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 });
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) SubspaceModel(de.lmu.ifi.dbs.elki.data.model.SubspaceModel) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Aggregations

Database (de.lmu.ifi.dbs.elki.database.Database)288 Test (org.junit.Test)240 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)151 ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)102 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)85 OutlierResult (de.lmu.ifi.dbs.elki.result.outlier.OutlierResult)69 AbstractOutlierAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)50 Model (de.lmu.ifi.dbs.elki.data.model.Model)29 CutDendrogramByNumberOfClusters (de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.extraction.CutDendrogramByNumberOfClusters)26 Clustering (de.lmu.ifi.dbs.elki.data.Clustering)14 StaticArrayDatabase (de.lmu.ifi.dbs.elki.database.StaticArrayDatabase)11 AbstractFrequentItemsetAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)10 AssociationRuleGeneration (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration)10 AssociationRuleResult (de.lmu.ifi.dbs.elki.result.AssociationRuleResult)10 ListParameterization (de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)10 AbstractSimpleAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.AbstractSimpleAlgorithmTest)9 MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)9 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)9 NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)8 DBIDs (de.lmu.ifi.dbs.elki.database.ids.DBIDs)8