use of de.lmu.ifi.dbs.elki.data.model.Model in project elki by elki-project.
the class GeneralizedDBSCANTest method testDBSCANResults.
/**
* Run Generalized 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<>(GeneralizedDBSCAN.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 });
}
use of de.lmu.ifi.dbs.elki.data.model.Model in project elki by elki-project.
the class ParallelGeneralizedDBSCANTest method testDBSCANOnSingleLinkDataset.
/**
* Run Generalized DBSCAN with fixed parameters and compare the result to a
* golden standard.
*/
@Test
public void testDBSCANOnSingleLinkDataset() {
Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
Clustering<Model> result = //
new ELKIBuilder<>(ParallelGeneralizedDBSCAN.class).with(DBSCAN.Parameterizer.EPSILON_ID, //
11.5).with(DBSCAN.Parameterizer.MINPTS_ID, //
120).build().run(db);
testFMeasure(db, result, 0.954382);
testClusterSizes(result, new int[] { 11, 200, 203, 224 });
}
use of de.lmu.ifi.dbs.elki.data.model.Model in project elki by elki-project.
the class OpenGL3DParallelCoordinates method getStylePolicy.
/**
* Hack: Get/Create the style result.
*
* @return Style result
*/
public StylingPolicy getStylePolicy(ResultHierarchy hier, StyleLibrary stylelib) {
Database db = ResultUtil.findDatabase(hier);
AutomaticEvaluation.ensureClusteringResult(db, db);
List<Clustering<? extends Model>> clusterings = Clustering.getClusteringResults(db);
if (clusterings.size() > 0) {
return new ClusterStylingPolicy(clusterings.get(0), stylelib);
} else {
throw new AbortException("No clustering result generated?!?");
}
}
use of de.lmu.ifi.dbs.elki.data.model.Model in project elki by elki-project.
the class PreDeConTest method testPreDeConResults.
/**
* Run PreDeCon with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testPreDeConResults() {
// Additional input parameters
ListParameterization inp = new ListParameterization();
inp.addParameter(AbstractDatabaseConnection.Parameterizer.FILTERS_ID, ClassLabelFilter.class);
inp.addParameter(ClassLabelFilter.Parameterizer.CLASS_LABEL_INDEX_ID, 1);
Database db = makeSimpleDatabase(UNITTEST + "axis-parallel-subspace-clusters-6d.csv.gz", 2500, inp);
Clustering<Model> result = //
new ELKIBuilder<PreDeCon<DoubleVector>>(PreDeCon.class).with(DBSCAN.Parameterizer.EPSILON_ID, //
60).with(DBSCAN.Parameterizer.MINPTS_ID, //
40).with(PreDeCon.Settings.Parameterizer.DELTA_ID, //
400).with(PreDeCon.Settings.Parameterizer.KAPPA_ID, //
20.).with(PreDeCon.Settings.Parameterizer.LAMBDA_ID, //
4).build().run(db);
// FIXME: find better working parameters?
testFMeasure(db, result, 0.724752);
testClusterSizes(result, new int[] { 43, 93, 108, 611, 638, 1007 });
}
use of de.lmu.ifi.dbs.elki.data.model.Model in project elki by elki-project.
the class DeLiCluTest method testDeLiCluResults.
/**
* Run DeLiClu with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testDeLiCluResults() {
ListParameterization indexparams = new ListParameterization();
// We need a special index for this algorithm:
indexparams.addParameter(StaticArrayDatabase.Parameterizer.INDEX_ID, DeLiCluTreeFactory.class);
indexparams.addParameter(AbstractPageFileFactory.Parameterizer.PAGE_SIZE_ID, 1000);
Database db = makeSimpleDatabase(UNITTEST + "hierarchical-2d.ascii", 710, indexparams);
Clustering<?> clustering = //
new ELKIBuilder<>(OPTICSXi.class).with(DeLiClu.Parameterizer.MINPTS_ID, //
18).with(OPTICSXi.Parameterizer.XI_ID, //
0.038).with(OPTICSXi.Parameterizer.XIALG_ID, //
DeLiClu.class).build().run(db);
// Test F-Measure
Clustering<Model> rbl = new ByLabelClustering().run(db);
ClusterContingencyTable ct = new ClusterContingencyTable(true, false);
ct.process(clustering, rbl);
double score = ct.getPaircount().f1Measure();
// identical each time, the results will vary.
if (Math.abs(score - 0.8771174) < 1e-5) {
assertEquals("Score does not match.", 0.8771174, score, 1e-5);
} else {
assertEquals("Score does not match.", 0.8819664, score, 1e-5);
}
}
Aggregations