Search in sources :

Example 11 with MedoidModel

use of de.lmu.ifi.dbs.elki.data.model.MedoidModel in project elki by elki-project.

the class AffinityPropagationClusteringAlgorithmTest method testAffinityPropagationClusteringAlgorithmResults.

/**
 * Run AffinityPropagationClusteringAlgorithm with fixed parameters and
 * compare the result to a golden standard.
 */
@Test
public void testAffinityPropagationClusteringAlgorithmResults() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<AffinityPropagationClusteringAlgorithm<DoubleVector>>(AffinityPropagationClusteringAlgorithm.class).build().run(db);
    testFMeasure(db, result, 0.957227259);
    testClusterSizes(result, new int[] { 5, 5, 7, 55, 105, 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) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 12 with MedoidModel

use of de.lmu.ifi.dbs.elki.data.model.MedoidModel in project elki by elki-project.

the class AffinityPropagationClusteringAlgorithmTest method testAffinityPropagationSimilarity.

/**
 * Run AffinityPropagationClusteringAlgorithm with fixed parameters and
 * compare the result to a golden standard.
 */
@Test
public void testAffinityPropagationSimilarity() {
    Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<AffinityPropagationClusteringAlgorithm<DoubleVector>>(AffinityPropagationClusteringAlgorithm.class).with(AffinityPropagationClusteringAlgorithm.Parameterizer.INITIALIZATION_ID, // 
    SimilarityBasedInitializationWithMedian.class).with(SimilarityBasedInitializationWithMedian.Parameterizer.SIMILARITY_ID, // 
    PolynomialKernelFunction.class).build().run(db);
    testFMeasure(db, result, 0.352103);
    testClusterSizes(result, new int[] { 20, 30, 32, 33, 34, 35, 36, 39, 39, 40, 43, 45, 45, 49, 49, 69 });
}
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 13 with MedoidModel

use of de.lmu.ifi.dbs.elki.data.model.MedoidModel in project elki by elki-project.

the class KMedoidsPAMReynoldsTest method testKMedoidsPAM.

/**
 * Run KMedians PAM with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testKMedoidsPAM() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<KMedoidsPAMReynolds<DoubleVector>>(KMedoidsPAMReynolds.class).with(KMeans.K_ID, // 
    5).build().run(db);
    testFMeasure(db, result, 0.998005);
    testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Example 14 with MedoidModel

use of de.lmu.ifi.dbs.elki.data.model.MedoidModel in project elki by elki-project.

the class KMedoidsPAMTest method testKMedoidsPAM.

/**
 * Run KMedians PAM with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testKMedoidsPAM() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<KMedoidsPAM<DoubleVector>>(KMedoidsPAM.class).with(KMeans.K_ID, // 
    5).build().run(db);
    testFMeasure(db, result, 0.998005);
    testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) MedoidModel(de.lmu.ifi.dbs.elki.data.model.MedoidModel) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest) Test(org.junit.Test)

Aggregations

MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)14 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)9 Database (de.lmu.ifi.dbs.elki.database.Database)9 Test (org.junit.Test)9 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)7 ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)7 Clustering (de.lmu.ifi.dbs.elki.data.Clustering)5 WritableIntegerDataStore (de.lmu.ifi.dbs.elki.database.datastore.WritableIntegerDataStore)2 FiniteProgress (de.lmu.ifi.dbs.elki.logging.progress.FiniteProgress)2 IndefiniteProgress (de.lmu.ifi.dbs.elki.logging.progress.IndefiniteProgress)2 StringStatistic (de.lmu.ifi.dbs.elki.logging.statistics.StringStatistic)2 AbortException (de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException)2 Random (java.util.Random)2 PAMInitialMeans (de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.initialization.PAMInitialMeans)1 ArrayDBIDs (de.lmu.ifi.dbs.elki.database.ids.ArrayDBIDs)1 DBIDArrayIter (de.lmu.ifi.dbs.elki.database.ids.DBIDArrayIter)1 ModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs)1 MutableProgress (de.lmu.ifi.dbs.elki.logging.progress.MutableProgress)1 DoubleStatistic (de.lmu.ifi.dbs.elki.logging.statistics.DoubleStatistic)1 LongStatistic (de.lmu.ifi.dbs.elki.logging.statistics.LongStatistic)1