laur.dm.ar
Class FrequentItemsetsMiner

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--laur.tools.AbortableThread
              |
              +--laur.tools.MonitoredThread
                    |
                    +--laur.dm.ar.FrequentItemsetsMiner
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Apriori, Closure, ClosureOpt, FPgrowth

public abstract class FrequentItemsetsMiner
extends MonitoredThread

This abstract class must be extended by the algorithms that will look for large itemsets.


Field Summary
protected  DBCacheWriter cache_writer
          With this object we write to the cache.
protected  DBReader db_reader
          With this object we read from the database
protected  double min_support
          Minimum support value.
 
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
FrequentItemsetsMiner()
           
 
Method Summary
protected  void execute()
          Executes the findFrequentItemsets() method.
abstract  int findFrequentItemsets(DBReader dbReader, DBCacheWriter cacheWriter, double minSupport)
          Find the frequent itemsets in a database
 int getResult()
          Gets the value returned by findFrequentItemsets() after the thread completed its execution.
 void setParameters(ThreadMonitor monitor, DBReader dbReader, DBCacheWriter cacheWriter, double minSupport)
          Sets the parameters for the mining algorithm.
 
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
 

Field Detail

db_reader

protected DBReader db_reader
With this object we read from the database

cache_writer

protected DBCacheWriter cache_writer
With this object we write to the cache.

min_support

protected double min_support
Minimum support value.
Constructor Detail

FrequentItemsetsMiner

public FrequentItemsetsMiner()
Method Detail

findFrequentItemsets

public abstract int findFrequentItemsets(DBReader dbReader,
                                         DBCacheWriter cacheWriter,
                                         double minSupport)
Find the frequent itemsets in a database
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

setParameters

public void setParameters(ThreadMonitor monitor,
                          DBReader dbReader,
                          DBCacheWriter cacheWriter,
                          double minSupport)
Sets the parameters for the mining algorithm. This method should be used before starting the thread.
Parameters:
monitor - an object that we should notify about important events
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
Throws:
IllegalStateException - if the thread is already running

execute

protected void execute()
Executes the findFrequentItemsets() method.
Overrides:
execute in class AbortableThread

getResult

public int getResult()
Gets the value returned by findFrequentItemsets() after the thread completed its execution.
Returns:
the number of passes executed over the database
Throws:
IllegalStateException - if the thread is still running or if no result is available