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 });
}
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);
}
}
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);
}
}
}
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);
}
}
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);
}
}
Aggregations