Search in sources :

Example 91 with DoubleVector

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

the class DBSCANTest method testDBSCANResults.

/**
 * Run DBSCAN with fixed parameters and compare the result to a golden
 * standard.
 */
@Test
public void testDBSCANResults() {
    Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
    Clustering<Model> result = // 
    new ELKIBuilder<DBSCAN<DoubleVector>>(DBSCAN.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) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) Test(org.junit.Test)

Example 92 with DoubleVector

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

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

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

the class ERiCTest method testERiCResults.

/**
 * Run ERiC with fixed parameters and compare the result to a golden standard.
 */
@Test
public void testERiCResults() {
    Database db = makeSimpleDatabase(UNITTEST + "hierarchical-3d2d1d.csv", 600);
    Clustering<CorrelationModel> result = // 
    new ELKIBuilder<ERiC<DoubleVector>>(ERiC.class).with(DBSCAN.Parameterizer.MINPTS_ID, // 
    30).with(ERiC.Parameterizer.DELTA_ID, // 
    0.20).with(ERiC.Parameterizer.TAU_ID, // 
    0.04).with(ERiC.Parameterizer.K_ID, // 
    50).with(PCARunner.Parameterizer.PCA_COVARIANCE_MATRIX, // 
    WeightedCovarianceMatrixBuilder.class).with(WeightedCovarianceMatrixBuilder.Parameterizer.WEIGHT_ID, // 
    ErfcWeight.class).with(EigenPairFilter.PCA_EIGENPAIR_FILTER, // 
    RelativeEigenPairFilter.class).with(RelativeEigenPairFilter.Parameterizer.EIGENPAIR_FILTER_RALPHA, // 
    1.60).build().run(db);
    // Hierarchical pairs scored: 0.9204825
    testFMeasure(db, result, 0.728074);
    testClusterSizes(result, new int[] { 109, 188, 303 });
}
Also used : RelativeEigenPairFilter(de.lmu.ifi.dbs.elki.math.linearalgebra.pca.filter.RelativeEigenPairFilter) ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) WeightedCovarianceMatrixBuilder(de.lmu.ifi.dbs.elki.math.linearalgebra.pca.WeightedCovarianceMatrixBuilder) CorrelationModel(de.lmu.ifi.dbs.elki.data.model.CorrelationModel) Test(org.junit.Test) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)

Example 95 with DoubleVector

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

the class ERiCTest method testERiCOverlap.

/**
 * Run ERiC with fixed parameters and compare the result to a golden standard.
 */
@Test
public void testERiCOverlap() {
    Database db = makeSimpleDatabase(UNITTEST + "correlation-overlap-3-5d.ascii", 650);
    Clustering<CorrelationModel> result = // 
    new ELKIBuilder<ERiC<DoubleVector>>(ERiC.class).with(DBSCAN.Parameterizer.MINPTS_ID, // 
    15).with(ERiC.Parameterizer.DELTA_ID, // 
    1.0).with(ERiC.Parameterizer.TAU_ID, // 
    1.0).with(ERiC.Parameterizer.K_ID, // 
    45).with(PCARunner.Parameterizer.PCA_COVARIANCE_MATRIX, // 
    WeightedCovarianceMatrixBuilder.class).with(WeightedCovarianceMatrixBuilder.Parameterizer.WEIGHT_ID, // 
    ErfcWeight.class).with(EigenPairFilter.PCA_EIGENPAIR_FILTER, // 
    PercentageEigenPairFilter.class).with(PercentageEigenPairFilter.Parameterizer.ALPHA_ID, // 
    0.6).build().run(db);
    testFMeasure(db, result, 0.831136946);
    testClusterSizes(result, new int[] { 29, 189, 207, 225 });
}
Also used : PercentageEigenPairFilter(de.lmu.ifi.dbs.elki.math.linearalgebra.pca.filter.PercentageEigenPairFilter) ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) WeightedCovarianceMatrixBuilder(de.lmu.ifi.dbs.elki.math.linearalgebra.pca.WeightedCovarianceMatrixBuilder) CorrelationModel(de.lmu.ifi.dbs.elki.data.model.CorrelationModel) Test(org.junit.Test) AbstractClusterAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)

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