Search in sources :

Example 1 with AssociationRuleResult

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

the class LiftTest 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.5).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Lift.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 2 with AssociationRuleResult

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

the class AddedValueTest 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, // 
    AddedValue.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)

Example 3 with AssociationRuleResult

use of de.lmu.ifi.dbs.elki.result.AssociationRuleResult 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());
}
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 4 with AssociationRuleResult

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

the class GiniIndexTest 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.2).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    GiniIndex.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 5 with AssociationRuleResult

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

the class ConvictionTest 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.5).with(AssociationRuleGeneration.Parameterizer.INTERESTMEASURE_ID, // 
    Conviction.class).build().run(db);
    assertEquals("Size not as expected.", 12, 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