Search in sources :

Example 21 with Database

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

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class EvaluateCIndex method processNewResult.

@Override
public void processNewResult(ResultHierarchy hier, Result result) {
    List<Clustering<?>> crs = Clustering.getClusteringResults(result);
    if (crs.size() < 1) {
        return;
    }
    Database db = ResultUtil.findDatabase(hier);
    Relation<O> rel = db.getRelation(distance.getInputTypeRestriction());
    DistanceQuery<O> dq = db.getDistanceQuery(rel, distance);
    for (Clustering<?> c : crs) {
        evaluateClustering(db, rel, dq, c);
    }
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) Clustering(de.lmu.ifi.dbs.elki.data.Clustering)

Example 23 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class EvaluateDBCV method processNewResult.

@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
    List<Clustering<?>> crs = Clustering.getClusteringResults(newResult);
    if (crs.size() < 1) {
        return;
    }
    Database db = ResultUtil.findDatabase(hier);
    TypeInformation typ = new CombinedTypeInformation(this.distanceFunction.getInputTypeRestriction(), TypeUtil.NUMBER_VECTOR_FIELD);
    Relation<O> rel = db.getRelation(typ);
    if (rel != null) {
        for (Clustering<?> cl : crs) {
            evaluateClustering(db, rel, cl);
        }
    }
}
Also used : CombinedTypeInformation(de.lmu.ifi.dbs.elki.data.type.CombinedTypeInformation) Database(de.lmu.ifi.dbs.elki.database.Database) Clustering(de.lmu.ifi.dbs.elki.data.Clustering) TypeInformation(de.lmu.ifi.dbs.elki.data.type.TypeInformation) CombinedTypeInformation(de.lmu.ifi.dbs.elki.data.type.CombinedTypeInformation)

Example 24 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class EvaluatePBMIndex method processNewResult.

@Override
public void processNewResult(ResultHierarchy hier, Result result) {
    List<Clustering<?>> crs = Clustering.getClusteringResults(result);
    if (crs.isEmpty()) {
        return;
    }
    Database db = ResultUtil.findDatabase(hier);
    Relation<? extends NumberVector> rel = db.getRelation(this.distanceFunction.getInputTypeRestriction());
    for (Clustering<?> c : crs) {
        evaluateClustering(db, (Relation<? extends NumberVector>) rel, c);
    }
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) Clustering(de.lmu.ifi.dbs.elki.data.Clustering)

Example 25 with Database

use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.

the class EvaluateVarianceRatioCriteria method processNewResult.

@Override
public void processNewResult(ResultHierarchy hier, Result result) {
    List<Clustering<?>> crs = Clustering.getClusteringResults(result);
    if (crs.isEmpty()) {
        return;
    }
    Database db = ResultUtil.findDatabase(hier);
    Relation<? extends NumberVector> rel = db.getRelation(EuclideanDistanceFunction.STATIC.getInputTypeRestriction());
    for (Clustering<?> c : crs) {
        evaluateClustering(db, (Relation<? extends NumberVector>) rel, c);
    }
}
Also used : Database(de.lmu.ifi.dbs.elki.database.Database) Clustering(de.lmu.ifi.dbs.elki.data.Clustering)

Aggregations

Database (de.lmu.ifi.dbs.elki.database.Database)288 Test (org.junit.Test)240 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)151 ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)102 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)85 OutlierResult (de.lmu.ifi.dbs.elki.result.outlier.OutlierResult)69 AbstractOutlierAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)50 Model (de.lmu.ifi.dbs.elki.data.model.Model)29 CutDendrogramByNumberOfClusters (de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.extraction.CutDendrogramByNumberOfClusters)26 Clustering (de.lmu.ifi.dbs.elki.data.Clustering)14 StaticArrayDatabase (de.lmu.ifi.dbs.elki.database.StaticArrayDatabase)11 AbstractFrequentItemsetAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)10 AssociationRuleGeneration (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration)10 AssociationRuleResult (de.lmu.ifi.dbs.elki.result.AssociationRuleResult)10 ListParameterization (de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)10 AbstractSimpleAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.AbstractSimpleAlgorithmTest)9 MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)9 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)9 NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)8 DBIDs (de.lmu.ifi.dbs.elki.database.ids.DBIDs)8