laur.dm.ar
Class AprioriRules

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--laur.tools.AbortableThread
              |
              +--laur.tools.MonitoredThread
                    |
                    +--laur.dm.ar.AssociationsMiner
                          |
                          +--laur.dm.ar.AprioriRules
All Implemented Interfaces:
java.lang.Runnable

public class AprioriRules
extends AssociationsMiner

This class implements the Apriori ap_genrules algorithm for finding association rules.

(see "Fast Algorithms for Mining Association Rules" by Rakesh Agrawal and Ramakrishnan Srikant from IBM Almaden Research Center 1994) We also implement a variant of ap_genrules that generates only rules having the user specified characteristics.


Fields inherited from class laur.dm.ar.AssociationsMiner
cache_reader, is_ignored, is_in_antecedent, is_in_consequent, max_antecedent, min_confidence, min_consequent, min_support
 
Fields inherited from class laur.tools.MonitoredThread
monitor
 
Fields inherited from class laur.tools.AbortableThread
bAbort, isRunning
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AprioriRules()
           
 
Method Summary
 java.util.ArrayList findAssociations(DBCacheReader cacheReader, double minSupport, double minConfidence)
          Find association rules in a database, given the set of frequent itemsets.
 java.util.ArrayList findAssociations(DBCacheReader cacheReader, double minSupport, double minConfidence, Itemset inAntecedent, Itemset inConsequent, Itemset ignored, int maxAntecedent, int minConsequent)
          Find association rules in a database, given the set of frequent itemsets and a set of restrictions.
 
Methods inherited from class laur.dm.ar.AssociationsMiner
execute, getResult, setParameters, setParameters
 
Methods inherited from class laur.tools.MonitoredThread
terminationHook
 
Methods inherited from class laur.tools.AbortableThread
abort, checkAbort, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AprioriRules

public AprioriRules()
Method Detail

findAssociations

public java.util.ArrayList findAssociations(DBCacheReader cacheReader,
                                            double minSupport,
                                            double minConfidence)
Find association rules in a database, given the set of frequent itemsets.
Overrides:
findAssociations in class AssociationsMiner
Parameters:
cacheReader - the object used to read from the cache
minSupport - the minimum support
minConfidence - the minimum confidence
Returns:
an ArrayList containing all association rules found

findAssociations

public java.util.ArrayList findAssociations(DBCacheReader cacheReader,
                                            double minSupport,
                                            double minConfidence,
                                            Itemset inAntecedent,
                                            Itemset inConsequent,
                                            Itemset ignored,
                                            int maxAntecedent,
                                            int minConsequent)
Find association rules in a database, given the set of frequent itemsets and a set of restrictions.
Overrides:
findAssociations in class AssociationsMiner
Parameters:
cacheReader - the object used to read from the cache
minSupport - the minimum support
minConfidence - the minimum confidence
inAntecedent - the items that must appear in the antecedent of each rule, if null then this constraint is ignored
inConsequent - the items that must appear in the consequent of each rule, if null then this constraint is ignored
ignored - the items that should be ignored, if null then this constraint is ignored
maxAntecedent - the maximum number of items that can appear in the antecedent of each rule, if 0 then this constraint is ignored
minConsequent - the minimum number of items that should appear in the consequent of each rule, if 0 then this constraint is ignored
Returns:
an ArrayList containing all association rules found