Search in sources :

Example 46 with Database

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

the class ParallelGeneralizedDBSCANTest method testParallelDBSCANResults.

/**
 * Run Generalized DBSCAN with fixed parameters and compare the result to a
 * golden standard.
 */
@Test
public void testParallelDBSCANResults() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<Model> result = // 
    new ELKIBuilder<>(ParallelGeneralizedDBSCAN.class).with(DBSCAN.Parameterizer.EPSILON_ID, // 
    0.04).with(DBSCAN.Parameterizer.MINPTS_ID, // 
    20).build().run(db);
    testFMeasure(db, result, 0.996413);
    testClusterSizes(result, new int[] { 29, 50, 101, 150 });
}
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) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 47 with Database

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

the class KMedoidsEMTest method testKMedoidsEM.

/**
 * Run KMedoidsEM with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testKMedoidsEM() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<KMedoidsEM<DoubleVector>>(KMedoidsEM.class).with(KMeans.K_ID, // 
    5).with(KMeans.INIT_ID, // 
    PAMInitialMeans.class).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) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 48 with Database

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

the class XMeansTest method testXMeans.

/**
 * A very basic X-means test run.
 */
@Test
public void testXMeans() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<?> result = // 
    new ELKIBuilder<XMeans<DoubleVector, ?>>(XMeans.class).with(XMeans.Parameterizer.K_MIN_ID, // 
    2).with(KMeans.K_ID, // 
    20).with(XMeans.Parameterizer.INNER_KMEANS_ID, // 
    KMeansLloyd.class).with(XMeans.Parameterizer.INFORMATION_CRITERION_ID, // 
    BayesianInformationCriterion.class).with(KMeans.SEED_ID, // // Initializer seed
    0).with(XMeans.Parameterizer.SEED_ID, // // X-means seed
    0).build().run(db);
    testFMeasure(db, result, 0.95927231008);
    testClusterSizes(result, new int[] { 1, 2, 2, 2, 3, 5, 5, 51, 106, 153 });
}
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 49 with Database

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

the class FarthestSumPointsInitialMeansTest method testFarthestSumPointsInitialMeans.

/**
 * Run KMeans with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testFarthestSumPointsInitialMeans() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<?> result = // 
    new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, // 
    5).with(KMeans.SEED_ID, // 
    3).with(KMeans.INIT_ID, // 
    FarthestSumPointsInitialMeans.class).build().run(db);
    testFMeasure(db, result, 0.80399668933);
    testClusterSizes(result, new int[] { 32, 169, 199, 201, 399 });
}
Also used : SingleAssignmentKMeans(de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans) Database(de.lmu.ifi.dbs.elki.database.Database) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 50 with Database

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

the class FirstKInitialMeansTest method testFirstKInitialMedoids.

/**
 * Run CLARA with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testFirstKInitialMedoids() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<?> result = // 
    new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, // 
    5).with(KMeans.INIT_ID, // 
    FirstKInitialMeans.class).with(KMeans.MAXITER_ID, // 
    1).with(CLARA.Parameterizer.SAMPLESIZE_ID, // 
    10).with(CLARA.Parameterizer.RANDOM_ID, // 
    0).build().run(db);
    testFMeasure(db, result, 0.7454859);
    testClusterSizes(result, new int[] { 45, 155, 200, 287, 313 });
}
Also used : CLARA(de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.CLARA) 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