use of de.lmu.ifi.dbs.elki.data.DoubleVector in project elki by elki-project.
the class KMeansBisectingTest method testKMeansBisectingFMeasure.
/**
* Run KMeansBisecting with fixed parameters (k = 2) and compare f-measure to
* golden standard.
*/
@Test
public void testKMeansBisectingFMeasure() {
Database db = makeSimpleDatabase(UNITTEST + "bisecting-test.csv", 300);
KMeansBisecting<DoubleVector, MeanModel> kmeans = //
new ELKIBuilder<KMeansBisecting<DoubleVector, MeanModel>>(KMeansBisecting.class).with(KMeans.K_ID, //
2).with(KMeans.SEED_ID, //
0).with(BestOfMultipleKMeans.Parameterizer.TRIALS_ID, //
5).with(BestOfMultipleKMeans.Parameterizer.KMEANS_ID, //
KMeansLloyd.class).with(BestOfMultipleKMeans.Parameterizer.QUALITYMEASURE_ID, //
WithinClusterVarianceQualityMeasure.class).build();
// run KMedians on database
Clustering<MeanModel> result = kmeans.run(db);
testFMeasure(db, result, 0.7408);
}
use of de.lmu.ifi.dbs.elki.data.DoubleVector in project elki by elki-project.
the class KMeansElkanTest method testKMeansElkan.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testKMeansElkan() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<KMeansElkan<DoubleVector>>(KMeansElkan.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
use of de.lmu.ifi.dbs.elki.data.DoubleVector in project elki by elki-project.
the class KMeansHybridLloydMacQueenTest method testKMeansHybridLloydMacQueen.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testKMeansHybridLloydMacQueen() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<KMeansHybridLloydMacQueen<DoubleVector>>(KMeansHybridLloydMacQueen.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
use of de.lmu.ifi.dbs.elki.data.DoubleVector in project elki by elki-project.
the class KMeansMacQueenTest method testKMeansMacQueen.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testKMeansMacQueen() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<KMeansMacQueen<DoubleVector>>(KMeansMacQueen.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
use of de.lmu.ifi.dbs.elki.data.DoubleVector in project elki by elki-project.
the class KMeansSortTest method testKMeansSort.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testKMeansSort() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<KMeansSort<DoubleVector>>(KMeansSort.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).build().run(db);
testFMeasure(db, result, 0.998005);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
Aggregations