public class TotalSupportTree extends AssocRuleMining
AssocRuleMining.RuleNode
Modifier and Type | Field and Description |
---|---|
protected long |
numUpdates
The number of updates required to generate the T-tree.
|
protected TtreeNode[] |
startTtreeRef
The reference to start of t-tree.
|
confidence, conversionArray, dataArray, dataset, isOrderedFlag, isPrunedFlag, minSupport, numCols, numOneItemSets, numRows, reconversionArray, startRulelist, support
Constructor and Description |
---|
TotalSupportTree(myDataset ds,
double sup,
double conf)
Constructor to process dataset and parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addToTtree(short[] itemSet,
int support)
Commences process of adding an itemset (with its support value) to a
T-tree when using a T-tree either as a storage mechanism, or when adding to
an existing T-tree.
|
protected TtreeNode[] |
addToTtree(TtreeNode[] linkRef,
int size,
int endIndex,
short[] itemSet,
int support)
Inserts a node into a T-tree.
|
protected int |
countNumFreqSets()
Commences process of counting the number of frequent (large/supported
sets contained in the T-tree.
|
protected int |
countNumFreqSets(int size,
TtreeNode[] linkRef,
int num)
Counts the number of supported nodes in a sub branch of the T-tree.
|
void |
generateARs()
Initiates process of generating Association Rules (ARs) from a
T-tree.
|
protected void |
generateARs(short[] itemSetSofar,
int size,
TtreeNode[] linkRef)
Continues process of generating association rules from a T-tree by
recursively looping through T-tree level by level.
|
protected void |
generateARs2()
Loops through top level of T-tree as part of the AR generation
process.
|
java.util.HashSet<java.lang.Integer> |
getCoveredRecords()
Retrieves all the records which are covered by the association rules
|
protected java.util.HashSet<java.lang.Integer> |
getCoveredRecords(short[] itemset) |
int |
getNumFreqSets()
Commences the process of counting and returning number of supported
nodes in the T-tree.
|
protected int |
getSupportForItemSetInTtree(short[] itemSet)
Commences process for finding the support value for the given item set
in the T-tree (which is know to exist in the T-tree).
|
void |
outputFrequentSets()
Commences the process of outputting the frequent sets contained in
the T-tree.
|
void |
setNumOneItemSets()
Sets the number of one item sets field (numOneItemSets to
the number of supported one item sets.
|
complement, copyItemSet, countSingles, defConvertArrays, getNumSupOneItemSets, getRulesSet, idInputDataOrdering, insertRuleintoRulelist, notMemberOf, orderFirstNofCountArray, outputDataArray, outputItemSet, outputRules, outputRules, realloc1, realloc2, reallocInsert, recastInputData, recastInputDataAndPruneUnsupportedAtts, reconvertItem, reconvertItemSet, removeElementN, sortItemSet, twoDecPlaces
protected TtreeNode[] startTtreeRef
protected long numUpdates
public TotalSupportTree(myDataset ds, double sup, double conf)
ds
- The instance of the dataset for dealing with its recordssup
- The user-specified minimum support for the mined association rulesconf
- The user-specified minimum confidence for the mined association rulespublic void addToTtree(short[] itemSet, int support)
itemSet
- The given itemset. Listed in numeric order (not reverse
numeric order!).support
- The support value associated with the given itemset.protected TtreeNode[] addToTtree(TtreeNode[] linkRef, int size, int endIndex, short[] itemSet, int support)
Recursive procedure.
linkRef
- the reference to the current array in Ttree.size
- the size of the current array in T-tree.endIndex
- the index of the last element/attribute in the itemset,
which is also used as a level counter.itemSet
- the given itemset.support
- the support value associated with the given itemset.protected int getSupportForItemSetInTtree(short[] itemSet)
Used when generating Association Rules (ARs). Note that itemsets are stored in reverse order in the T-tree therefore the given itemset must be processed in reverse.
itemSet
- the given itemset.public void generateARs()
protected void generateARs2()
protected void generateARs(short[] itemSetSofar, int size, TtreeNode[] linkRef)
itemSetSofar
- the label for a T-tree node as generated sofar.size
- the length/size of the current array lavel in the T-tree.linkRef
- the reference to the current array level in the T-tree.public void setNumOneItemSets()
public void outputFrequentSets()
protected int countNumFreqSets()
protected int countNumFreqSets(int size, TtreeNode[] linkRef, int num)
size
- the length/size of the current array level in the T-tree.linkRef
- the reference to the current array level in the T-tree.num
- the number of frequent sets sofar.public int getNumFreqSets()
A supported set is assumed to be a non null node in the T-tree.
protected java.util.HashSet<java.lang.Integer> getCoveredRecords(short[] itemset)
public java.util.HashSet<java.lang.Integer> getCoveredRecords()