external.modified
Class SET

java.lang.Object
  extended by external.modified.SET

public class SET
extends java.lang.Object

Implements a Set Enumeration Tree, which is a prefix tree used for storing and retrieving itemset information.

Author:
Laurentiu Cristofor

Constructor Summary
SET()
          Create a new empty SET.
 
Method Summary
 java.util.ArrayList getItemsets()
          Return the itemsets of the SET.
 java.util.ArrayList getLargeItemsets()
          Return the maximal itemsets of the SET.
 double getSupport(laur.dm.ar.Itemset itemset)
          Return the support for a given itemset.
static void initializeSET(SET supports, double minSupport, java.util.ArrayList itemsets)
          MOD: New interface to class needed, as TTM Testbench does not use cacheReader.
static void initializeSET(SET supports, double minSupport, laur.dm.ar.DBCacheReader cacheReader)
          Fills a SET with all frequent itemsets read from cacheReader that have support greater than min_support
 void insert(laur.dm.ar.Itemset itemset)
          Insert a new itemset in the SET.
static void main(java.lang.String[] args)
          sample usage and testing
 java.lang.String toString()
          Return a string representation of the SET.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SET

public SET()
Create a new empty SET.

Method Detail

insert

public void insert(laur.dm.ar.Itemset itemset)
Insert a new itemset in the SET.

Parameters:
itemset - the itemset to be inserted
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty

getSupport

public double getSupport(laur.dm.ar.Itemset itemset)
                  throws laur.dm.ar.SETException
Return the support for a given itemset.

Parameters:
itemset - the itemset for which we want to obtain the support
Returns:
support
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty
laur.dm.ar.SETException - itemset not found in SET

getLargeItemsets

public java.util.ArrayList getLargeItemsets()
Return the maximal itemsets of the SET.

Returns:
a vector containing the maximal itemsets from the SET

getItemsets

public java.util.ArrayList getItemsets()
Return the itemsets of the SET.

Returns:
a vector containing the itemsets from the SET

initializeSET

public static void initializeSET(SET supports,
                                 double minSupport,
                                 java.util.ArrayList itemsets)
MOD: New interface to class needed, as TTM Testbench does not use cacheReader. The whole method is new. Fills a SET with all frequent itemsets that have support greater than min_support

Parameters:
supports - The SET to be filled
minSupport - Minimum support
itemsets - List of itemsets

initializeSET

public static void initializeSET(SET supports,
                                 double minSupport,
                                 laur.dm.ar.DBCacheReader cacheReader)
Fills a SET with all frequent itemsets read from cacheReader that have support greater than min_support

Parameters:
supports - the SET to be filled
minSupport - the minimum support threshold
cacheReader - a DBCacheReader object from which the itemsets can be read

toString

public java.lang.String toString()
Return a string representation of the SET.

Overrides:
toString in class java.lang.Object
Returns:
string representation of SET

main

public static void main(java.lang.String[] args)
sample usage and testing