use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class KMeansPlusPlusInitialMeansTest method testSingleAssignmentKMeansPlusPlusMedoids.
/**
* Run CLARA with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testSingleAssignmentKMeansPlusPlusMedoids() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
3).with(KMeans.INIT_ID, //
KMeansPlusPlusInitialMeans.class).with(KMeans.MAXITER_ID, //
1).with(CLARA.Parameterizer.SAMPLESIZE_ID, //
10).with(CLARA.Parameterizer.RANDOM_ID, //
0).build().run(db);
testFMeasure(db, result, 0.932711);
testClusterSizes(result, new int[] { 165, 199, 201, 201, 234 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class RandomlyChosenInitialMeansTest method testRandomlyChosenInitialMedoids.
/**
* Run CLARA with fixed parameters and compare the result to a golden
* standard.
*/
@Test
public void testRandomlyChosenInitialMedoids() {
Database db = makeSimpleDatabase(UNITTEST + "different-densities-2d-no-noise.ascii", 1000);
Clustering<?> result = //
new ELKIBuilder<CLARA<DoubleVector>>(CLARA.class).with(KMeans.K_ID, //
5).with(KMeans.SEED_ID, //
7).with(KMeans.INIT_ID, //
RandomlyChosenInitialMeans.class).with(KMeans.MAXITER_ID, //
1).with(CLARA.Parameterizer.SAMPLESIZE_ID, //
10).with(CLARA.Parameterizer.RANDOM_ID, //
0).build().run(db);
testFMeasure(db, result, 0.99602);
testClusterSizes(result, new int[] { 198, 200, 200, 200, 202 });
}
use of de.lmu.ifi.dbs.elki.database.Database 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 });
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class FPGrowthTest method testLarge.
@Test
public void testLarge() {
Database db = loadTransactions(UNITTEST + "itemsets/zutaten.txt.gz", 16401);
FrequentItemsetsResult res = //
new ELKIBuilder<>(FPGrowth.class).with(FPGrowth.Parameterizer.MINSUPP_ID, 200).build().run(db);
assertEquals("Size not as expected.", 184, res.getItemsets().size());
}
use of de.lmu.ifi.dbs.elki.database.Database in project elki by elki-project.
the class CertaintyFactorTest method testToyExample.
@Test
public void testToyExample() {
Database db = loadTransactions(UNITTEST + "itemsets/increasing5.txt", 5);
AssociationRuleResult res = //
new ELKIBuilder<>(AssociationRuleGeneration.class).with(FPGrowth.Parameterizer.MINSUPP_ID, //
2).with(AssociationRuleGeneration.Parameterizer.MINMEASURE_ID, //
1.).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, //
CertaintyFactor.class).build().run(db);
assertEquals("Size not as expected.", 18, res.getRules().size());
}
Aggregations