Search in sources :

Example 6 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult in project elki by elki-project.

the class JaccardTest 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, // 
    1).with(AssociationRuleGeneration.Parameterizer.MINMEASURE_ID, // 
    0.6).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Jaccard.class).build().run(db);
    assertEquals("Size not as expected.", 30, res.getRules().size());
}
Also used : AssociationRuleResult(de.lmu.ifi.dbs.elki.result.AssociationRuleResult) AssociationRuleGeneration(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration) Database(de.lmu.ifi.dbs.elki.database.Database) Test(org.junit.Test) AbstractFrequentItemsetAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)

Example 7 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult in project elki by elki-project.

the class LeverageTest 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, // 
    0.16).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Leverage.class).build().run(db);
    assertEquals("Size not as expected.", 18, res.getRules().size());
}
Also used : AssociationRuleResult(de.lmu.ifi.dbs.elki.result.AssociationRuleResult) AssociationRuleGeneration(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration) Database(de.lmu.ifi.dbs.elki.database.Database) Test(org.junit.Test) AbstractFrequentItemsetAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)

Example 8 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult in project elki by elki-project.

the class CosineTest 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, // 
    0.86).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Cosine.class).build().run(db);
    assertEquals("Size not as expected.", 8, res.getRules().size());
}
Also used : AssociationRuleResult(de.lmu.ifi.dbs.elki.result.AssociationRuleResult) AssociationRuleGeneration(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration) Database(de.lmu.ifi.dbs.elki.database.Database) Test(org.junit.Test) AbstractFrequentItemsetAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)

Example 9 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult in project elki by elki-project.

the class JMeasureTest 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, // 
    0.1).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    JMeasure.class).build().run(db);
    assertEquals("Size not as expected.", 9, res.getRules().size());
}
Also used : AssociationRuleResult(de.lmu.ifi.dbs.elki.result.AssociationRuleResult) AssociationRuleGeneration(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration) Database(de.lmu.ifi.dbs.elki.database.Database) Test(org.junit.Test) AbstractFrequentItemsetAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)

Example 10 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult in project elki by elki-project.

the class KlosgenTest 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, // 
    1).with(AssociationRuleGeneration.Parameterizer.MINMEASURE_ID, // 
    0.26).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Klosgen.class).build().run(db);
    assertEquals("Size not as expected.", 27, res.getRules().size());
}
Also used : AssociationRuleResult(de.lmu.ifi.dbs.elki.result.AssociationRuleResult) AssociationRuleGeneration(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration) Database(de.lmu.ifi.dbs.elki.database.Database) Test(org.junit.Test) AbstractFrequentItemsetAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)

Aggregations

AbstractFrequentItemsetAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.AbstractFrequentItemsetAlgorithmTest)10 AssociationRuleGeneration (de.lmu.ifi.dbs.elki.algorithm.itemsetmining.associationrules.AssociationRuleGeneration)10 Database (de.lmu.ifi.dbs.elki.database.Database)10 AssociationRuleResult (de.lmu.ifi.dbs.elki.result.AssociationRuleResult)10 Test (org.junit.Test)10