Search in sources :

Example 1 with DoubleVector

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

the class EMTest method testEMMLEMultivariate.

@Test
public void testEMMLEMultivariate() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710);
    Clustering<?> result = // 
    new ELKIBuilder<EM<DoubleVector, ?>>(EM.class).with(KMeans.SEED_ID, // 
    0).with(EM.Parameterizer.K_ID, // 
    6).build().run(db);
    testFMeasure(db, result, 0.967410486);
    testClusterSizes(result, new int[] { 3, 5, 91, 98, 200, 313 });
}
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 2 with DoubleVector

use of de.lmu.ifi.dbs.elki.data.DoubleVector 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 3 with DoubleVector

use of de.lmu.ifi.dbs.elki.data.DoubleVector 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 4 with DoubleVector

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

the class CLARANSTest method testCLARANSNoise.

@Test
public void testCLARANSNoise() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<CLARANS<DoubleVector>>(CLARANS.class).with(KMeans.K_ID, // 
    3).with(CLARANS.Parameterizer.RANDOM_ID, // 
    0).with(CLARANS.Parameterizer.NEIGHBORS_ID, // 
    .1).with(CLARANS.Parameterizer.RESTARTS_ID, // 
    5).build().run(db);
    testFMeasure(db, result, 0.913858);
    testClusterSizes(result, new int[] { 57, 115, 158 });
}
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 5 with DoubleVector

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

the class CLARATest method testCLARA.

/**
 * Run CLARA with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testCLARA() {
    Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
    Clustering<MedoidModel> result = // 
    new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, // 
    5).with(CLARA.Parameterizer.RANDOM_ID, // 
    1).with(CLARA.Parameterizer.NUMSAMPLES_ID, // 
    2).with(CLARA.Parameterizer.SAMPLESIZE_ID, // 
    50).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)

Aggregations

DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)147 Test (org.junit.Test)112 Database (de.lmu.ifi.dbs.elki.database.Database)85 ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)75 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)50 MultipleObjectsBundle (de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle)26 AbstractDataSourceTest (de.lmu.ifi.dbs.elki.datasource.AbstractDataSourceTest)24 OutlierResult (de.lmu.ifi.dbs.elki.result.outlier.OutlierResult)22 AbstractOutlierAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)16 ArrayList (java.util.ArrayList)14 DBIDs (de.lmu.ifi.dbs.elki.database.ids.DBIDs)12 NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)11 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)10 VectorFieldTypeInformation (de.lmu.ifi.dbs.elki.data.type.VectorFieldTypeInformation)9 ListParameterization (de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)9 Random (java.util.Random)9 AbstractSimpleAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.AbstractSimpleAlgorithmTest)8 Model (de.lmu.ifi.dbs.elki.data.model.Model)8 LinearScanDistanceKNNQuery (de.lmu.ifi.dbs.elki.database.query.knn.LinearScanDistanceKNNQuery)8 MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)7