Search in sources :

Example 21 with ELKIBuilder

use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder 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 22 with ELKIBuilder

use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder 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 23 with ELKIBuilder

use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder 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 24 with ELKIBuilder

use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.

the class ParallelLloydKMeansTest method testParallelKMeansLloyd.

/**
 * Run KMeans with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testParallelKMeansLloyd() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<?> result = // 
    new ELKIBuilder<ParallelLloydKMeans<DoubleVector>>(ParallelLloydKMeans.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)

Example 25 with ELKIBuilder

use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.

the class AnderbergHierarchicalClusteringTest 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, // 
    AnderbergHierarchicalClustering.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)

Aggregations

ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)114 Test (org.junit.Test)111 Database (de.lmu.ifi.dbs.elki.database.Database)102 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)75 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)73 OutlierResult (de.lmu.ifi.dbs.elki.result.outlier.OutlierResult)26 AbstractOutlierAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)22 Model (de.lmu.ifi.dbs.elki.data.model.Model)11 AbstractDataSourceTest (de.lmu.ifi.dbs.elki.datasource.AbstractDataSourceTest)10 MultipleObjectsBundle (de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle)10 MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)7 SubspaceModel (de.lmu.ifi.dbs.elki.data.model.SubspaceModel)5 InputStreamDatabaseConnection (de.lmu.ifi.dbs.elki.datasource.InputStreamDatabaseConnection)3 WeightedCovarianceMatrixBuilder (de.lmu.ifi.dbs.elki.math.linearalgebra.pca.WeightedCovarianceMatrixBuilder)3 InputStream (java.io.InputStream)3 CorrelationModel (de.lmu.ifi.dbs.elki.data.model.CorrelationModel)2 PercentageEigenPairFilter (de.lmu.ifi.dbs.elki.math.linearalgebra.pca.filter.PercentageEigenPairFilter)2 KolmogorovSmirnovTest (de.lmu.ifi.dbs.elki.math.statistics.tests.KolmogorovSmirnovTest)2 WelchTTest (de.lmu.ifi.dbs.elki.math.statistics.tests.WelchTTest)2 ArrayList (java.util.ArrayList)2