use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans in project elki by elki-project.
the class FarthestSumPointsInitialMeansTest method testFarthestSumPointsInitialMeans.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testFarthestSumPointsInitialMeans() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
3).with(KMeans.INIT_ID, //
FarthestSumPointsInitialMeans.class).build().run(db);
testFMeasure(db, result, 0.80399668933);
testClusterSizes(result, new int[] { 32, 169, 199, 201, 399 });
}
use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans in project elki by elki-project.
the class RandomlyGeneratedInitialMeansTest method testRandomlyGeneratedInitialMeans.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testRandomlyGeneratedInitialMeans() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
0).with(KMeans.INIT_ID, //
RandomlyGeneratedInitialMeans.class).build().run(db);
testFMeasure(db, result, 0.74344789);
testClusterSizes(result, new int[] { 1, 145, 208, 246, 400 });
}
use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans in project elki by elki-project.
the class FarthestPointsInitialMeansTest method testFarthestPointsInitialMeans.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testFarthestPointsInitialMeans() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
3).with(KMeans.INIT_ID, //
FarthestPointsInitialMeans.class).build().run(db);
testFMeasure(db, result, 0.88132453);
testClusterSizes(result, new int[] { 128, 199, 201, 201, 271 });
}
use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans in project elki by elki-project.
the class KMeansPlusPlusInitialMeansTest method testSingleAssignmentKMeansPlusPlus.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testSingleAssignmentKMeansPlusPlus() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
3).with(KMeans.INIT_ID, //
KMeansPlusPlusInitialMeans.class).build().run(db);
testFMeasure(db, result, 0.99800500);
testClusterSizes(result, new int[] { 199, 200, 200, 200, 201 });
}
use of de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.SingleAssignmentKMeans in project elki by elki-project.
the class RandomlyChosenInitialMeansTest method testRandomlyChosenInitialMeans.
/**
* Run KMeans with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testRandomlyChosenInitialMeans() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<SingleAssignmentKMeans<DoubleVector>>(SingleAssignmentKMeans.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).with(KMeans.INIT_ID, //
RandomlyChosenInitialMeans.class).build().run(db);
testFMeasure(db, result, 0.702733);
testClusterSizes(result, new int[] { 64, 95, 202, 306, 333 });
}
Aggregations