Search in sources :

Example 61 with Database

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

the class AffinityPropagationClusteringAlgorithmTest method testAffinityPropagationClusteringAlgorithmOnSingleLinkDataset.

/**
 * Run AffinityPropagationClusteringAlgorithm with fixed parameters and
 * compare the result to a golden standard.
 */
@Test
public void testAffinityPropagationClusteringAlgorithmOnSingleLinkDataset() {
    Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<AffinityPropagationClusteringAlgorithm<DoubleVector>>(AffinityPropagationClusteringAlgorithm.class).build().run(db);
    testFMeasure(db, result, 0.351689882);
    testClusterSizes(result, new int[] { 24, 27, 29, 34, 36, 36, 37, 38, 41, 43, 43, 44, 46, 47, 56, 57 });
}
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) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 62 with Database

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

the class LMCLUSTest method testLMCLUSOverlap.

/**
 * Run LMCLUS with fixed parameters and compare the result to a golden standard.
 */
@Test
public void testLMCLUSOverlap() {
    Database db = makeSimpleDatabase(UNITTEST + "correlation-overlap-3-5d.ascii", 650);
    Clustering<Model> result = // 
    new ELKIBuilder<>(LMCLUS.class).with(LMCLUS.Parameterizer.MINSIZE_ID, // 
    100).with(LMCLUS.Parameterizer.THRESHOLD_ID, // 
    10).with(LMCLUS.Parameterizer.RANDOM_ID, // 
    0).build().run(db);
    testClusterSizes(result, new int[] { 200, 201, 249 });
    testFMeasure(db, result, 0.921865);
}
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 63 with Database

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

the class CLARANSTest method testCLARANS.

@Test
public void testCLARANS() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<CLARANS<DoubleVector>>(CLARANS.class).with(KMeans.K_ID, // 
    5).with(CLARANS.Parameterizer.RANDOM_ID, // 
    0).with(CLARANS.Parameterizer.NEIGHBORS_ID, // 
    10).with(CLARANS.Parameterizer.RESTARTS_ID, // 
    5).build().run(db);
    testFMeasure(db, result, 0.996);
    testClusterSizes(result, new int[] { 198, 200, 200, 200, 202 });
}
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) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 64 with Database

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

the class KMeansBatchedLloydTest method testKMeansBatchedLloyd.

/**
 * Run KMeans with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testKMeansBatchedLloyd() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<?> result = // 
    new ELKIBuilder<KMeansBatchedLloyd<DoubleVector>>(KMeansBatchedLloyd.class).with(KMeans.K_ID, // 
    5).with(KMeans.SEED_ID, // 
    7).with(KMeansBatchedLloyd.Parameterizer.BLOCKS_ID, // 
    10).with(KMeansBatchedLloyd.Parameterizer.RANDOM_ID, // 
    0).build().run(db);
    testFMeasure(db, result, 0.998005);
    testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
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 65 with Database

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

the class KMeansCompareTest method testKMeansCompare.

/**
 * Run KMeans with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testKMeansCompare() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<?> result = // 
    new ELKIBuilder<KMeansCompare<DoubleVector>>(KMeansCompare.class).with(KMeans.K_ID, // 
    5).with(KMeans.SEED_ID, // 
    7).build().run(db);
    testFMeasure(db, result, 0.998005);
    testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
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)

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