external.modified
Class Apriori

java.lang.Object
  extended by java.lang.Thread
      extended by laur.tools.AbortableThread
          extended by laur.tools.MonitoredThread
              extended by laur.dm.ar.FrequentItemsetsMiner
                  extended by external.modified.Apriori
All Implemented Interfaces:
java.lang.Runnable

public class Apriori
extends laur.dm.ar.FrequentItemsetsMiner

This class implements the Apriori algorithm for finding frequent itemsets.

(see "Fast Algorithms for Mining Association Rules" by Rakesh Agrawal and Ramakrishnan Srikant from IBM Almaden Research Center 1994)

Author:
Laurentiu Cristofor

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class laur.dm.ar.FrequentItemsetsMiner
cache_writer, db_reader, 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
Apriori()
           
 
Method Summary
 java.util.ArrayList findFrequentItemsets(java.util.ArrayList data, int nofObjects, double minSupport, double maxSupport, int maxSetSize)
          MOD: New interface to class needed, as TTM Testbench does not use cacheWriter.
 int findFrequentItemsets(laur.dm.ar.DBReader dbReader, laur.dm.ar.DBCacheWriter cacheWriter, double minSupport)
          Find the frequent itemsets in a database
 
Methods inherited from class laur.dm.ar.FrequentItemsetsMiner
execute, getResult, 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, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

Apriori

public Apriori()
Method Detail

findFrequentItemsets

public java.util.ArrayList findFrequentItemsets(java.util.ArrayList data,
                                                int nofObjects,
                                                double minSupport,
                                                double maxSupport,
                                                int maxSetSize)
MOD: New interface to class needed, as TTM Testbench does not use cacheWriter. Find frequent itemsets based on a given list of transactions.

Parameters:
data - List of transactions
nofObjects - The number of terms
minSupport - Minimum support
maxSupport - Maximum support
maxSetSize - Maximum set size
Returns:
List of frequent itemsets

findFrequentItemsets

public int findFrequentItemsets(laur.dm.ar.DBReader dbReader,
                                laur.dm.ar.DBCacheWriter cacheWriter,
                                double minSupport)
Find the frequent itemsets in a database

Specified by:
findFrequentItemsets in class laur.dm.ar.FrequentItemsetsMiner
Parameters:
dbReader - the object used to read from the database
cacheWriter - the object used to write to the cache if this is null, then nothing will be saved, this is useful for benchmarking
minSupport - the minimum support
Returns:
the number of passes executed over the database