Search in sources :

Example 96 with DoubleVector

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

the class EMTest method testEMMAPTextbook.

@Test
public void testEMMAPTextbook() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710);
    Clustering<?> result = // 
    new ELKIBuilder<EM<DoubleVector, ?>>(EM.class).with(KMeans.SEED_ID, // 
    0).with(EM.Parameterizer.PRIOR_ID, // 
    10).with(EM.Parameterizer.K_ID, // 
    5).with(EM.Parameterizer.INIT_ID, // 
    TextbookMultivariateGaussianModelFactory.class).build().run(db);
    testFMeasure(db, result, 0.958843);
    testClusterSizes(result, new int[] { 3, 95, 97, 202, 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 97 with DoubleVector

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

the class EMTest method testEMMAPTwoPass.

@Test
public void testEMMAPTwoPass() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710);
    Clustering<?> result = // 
    new ELKIBuilder<EM<DoubleVector, ?>>(EM.class).with(KMeans.SEED_ID, // 
    0).with(EM.Parameterizer.PRIOR_ID, // 
    10).with(EM.Parameterizer.K_ID, // 
    5).with(EM.Parameterizer.INIT_ID, // 
    TwoPassMultivariateGaussianModelFactory.class).build().run(db);
    testFMeasure(db, result, 0.958843);
    testClusterSizes(result, new int[] { 3, 95, 97, 202, 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 98 with DoubleVector

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

the class EMTest method testEMMAPSpherical.

@Test
public void testEMMAPSpherical() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710);
    Clustering<?> result = // 
    new ELKIBuilder<EM<DoubleVector, ?>>(EM.class).with(KMeans.SEED_ID, // 
    1).with(EM.Parameterizer.K_ID, // 
    4).with(EM.Parameterizer.INIT_ID, // 
    SphericalGaussianModelFactory.class).with(EM.Parameterizer.PRIOR_ID, // 
    10).build().run(db);
    testFMeasure(db, result, 0.9357286);
    testClusterSizes(result, new int[] { 103, 104, 208, 295 });
}
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 99 with DoubleVector

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

the class LSDBCTest method testLSDBCOnSingleLinkDataset.

@Test
public void testLSDBCOnSingleLinkDataset() {
    Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
    Clustering<Model> result = // 
    new ELKIBuilder<LSDBC<DoubleVector>>(LSDBC.class).with(LSDBC.Parameterizer.ALPHA_ID, // 
    0.2).with(LSDBC.Parameterizer.K_ID, // 
    120).build().run(db);
    testFMeasure(db, result, 0.95681073);
    testClusterSizes(result, new int[] { 32, 197, 203, 206 });
}
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 100 with DoubleVector

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

the class FourCTest method testFourCOverlap.

/**
 * Run 4C with fixed parameters and compare the result to a golden standard.
 */
@Test
public void testFourCOverlap() {
    Database db = makeSimpleDatabase(UNITTEST + "correlation-overlap-3-5d.ascii", 650);
    Clustering<Model> result = // 
    new ELKIBuilder<FourC<DoubleVector>>(FourC.class).with(DBSCAN.Parameterizer.EPSILON_ID, // 
    3).with(DBSCAN.Parameterizer.MINPTS_ID, // 
    50).with(LimitEigenPairFilter.Parameterizer.EIGENPAIR_FILTER_DELTA, // 
    0.5).with(FourC.Settings.Parameterizer.LAMBDA_ID, // 
    3).build().run(db);
    testFMeasure(db, result, 0.9073744);
    testClusterSizes(result, new int[] { 200, 202, 248 });
}
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)

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