Search in sources :

Example 6 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class EMTest method testEMMAPDiagonal.

@Test
public void testEMMAPDiagonal() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710);
    Clustering<?> result = // 
    new ELKIBuilder<EM<DoubleVector, ?>>(EM.class).with(KMeans.SEED_ID, // 
    3).with(EM.Parameterizer.K_ID, // 
    5).with(EM.Parameterizer.INIT_ID, // 
    DiagonalGaussianModelFactory.class).with(EM.Parameterizer.PRIOR_ID, // 
    10).build().run(db);
    testFMeasure(db, result, 0.949566);
    testClusterSizes(result, new int[] { 6, 97, 98, 202, 307 });
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 7 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class LSDBCTest method testLSDBCResults.

@Test
public void testLSDBCResults() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<Model> result = // 
    new ELKIBuilder<LSDBC<DoubleVector>>(LSDBC.class).with(LSDBC.Parameterizer.ALPHA_ID, // 
    0.4).with(LSDBC.Parameterizer.K_ID, // 
    20).build().run(db);
    testFMeasure(db, result, 0.44848979);
    testClusterSizes(result, new int[] { 38, 38, 41, 54, 159 });
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) Model(de.lmu.ifi.dbs.elki.data.model.Model) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 8 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class AGNESTest 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, // 
    AGNES.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 });
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 9 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class AGNESTest method testSingleLink.

// TODO: add more data sets.
/**
 * Run agglomerative hierarchical clustering with fixed parameters and compare
 * the result to a golden standard.
 */
@Test
public void testSingleLink() {
    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, // 
    AGNES.class).with(AGNES.Parameterizer.LINKAGE_ID, // 
    SingleLinkage.class).build().run(db);
    testFMeasure(db, clustering, 0.6829722);
    testClusterSizes(clustering, new int[] { 9, 200, 429 });
}
Also used : CutDendrogramByNumberOfClusters(de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.extraction.CutDendrogramByNumberOfClusters) Database(de.lmu.ifi.dbs.elki.database.Database) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 10 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class AGNESTest 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, // 
    AGNES.class).with(AGNES.Parameterizer.LINKAGE_ID, // 
    CompleteLinkage.class).build().run(db);
    testFMeasure(db, clustering, 0.938167802);
    testClusterSizes(clustering, new int[] { 200, 217, 221 });
}
Also used : CutDendrogramByNumberOfClusters(de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.extraction.CutDendrogramByNumberOfClusters) Database(de.lmu.ifi.dbs.elki.database.Database) 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