|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwpi.associations.arminer.HashTree
HashTree.java
A HashTree is a special data structure that is used to index a Vector of ARMinerItemset objects for more efficient processing.
Nested Class Summary | |
private static class |
HashTree.HashNode
|
private static class |
HashTree.ListNode
|
private static class |
HashTree.MyHashtable
|
private static class |
HashTree.Node
|
Field Summary | |
private int |
counter
|
private static int |
DEFAULT_HASH_SIZE
|
private static int |
DEFAULT_LIST_SIZE
|
private static int |
HASH_NODE
|
private static int |
HASH_SIZE
|
private java.util.Vector |
itemsets
|
private java.util.Vector |
leaves
|
private static int |
LIST_NODE
|
private static int |
LIST_SIZE
|
private static int[] |
primes
|
private HashTree.Node |
theRoot
|
Constructor Summary | |
HashTree(int listSize,
int hashSize,
java.util.Vector itemsets)
Create a new HashTree. |
|
HashTree(java.util.Vector itemsets)
Create a new HashTree. |
Method Summary | |
private HashTree.Node |
add(HashTree.Node node,
int level,
int index)
|
void |
add(int index)
This method indexes in the HashTree the ARMinerItemset at index index from Vector itemsets which
was passed to the constructor of this HashTree. |
void |
checkLargeness(ARMinerItemset itemset)
Verifies if any of the indexed Itemsets is not large by checking whether they're included in the frequent itemset itemset . |
private void |
checkLargeness(HashTree.Node node,
ARMinerItemset itemset,
int index,
int level)
|
long |
countFrequentSubsets(ARMinerItemset itemset,
long minWeight)
Count how many frequent Itemsets (frequent = having weight greater than a specified minimum weight) are included in itemset |
private void |
countFrequentSubsets(HashTree.Node node,
ARMinerItemset itemset,
int index,
long minWeight,
int level)
|
long |
countSubsets(ARMinerItemset itemset)
Count how many Itemsets are included in itemset |
private void |
countSubsets(HashTree.Node node,
ARMinerItemset itemset,
int index,
int level)
|
private static int |
hash(int item,
int level)
|
private void |
prepare(HashTree.Node node)
|
void |
prepareForDescent()
This method should be called before calling update() to gather all leaves of the HashTree for more efficient processing. |
private void |
unvisitLeaves()
|
void |
update(ARMinerItemset row)
Update the weights of all indexed Itemsets that are included in row |
void |
update(ARMinerItemset row,
long[][] counts)
Update the weights of all indexed Itemsets that are included in row and also update the matrix counts |
private void |
update(HashTree.Node node,
ARMinerItemset row,
int index,
int level)
|
private void |
update(HashTree.Node node,
ARMinerItemset row,
int index,
long[][] counts,
int level)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int LIST_NODE
private static final int HASH_NODE
private static final int DEFAULT_LIST_SIZE
private static final int DEFAULT_HASH_SIZE
private static int LIST_SIZE
private static int HASH_SIZE
private static int[] primes
private int counter
private java.util.Vector leaves
private java.util.Vector itemsets
private HashTree.Node theRoot
Constructor Detail |
public HashTree(int listSize, int hashSize, java.util.Vector itemsets)
listSize
parameter determines
after how many inserts in a ListNode we have to change it to a
HashNode (i.e. perform a split). The hashSize
parameter
can be specified to improve the efficiency of the structure.
listSize
- the size of the internal lists in the list nodeshashSize
- the size of the internal hashtables in the hash nodesitemsets
- the Vector of Itemsets that we should index
java.lang.IllegalArgumentException
- itemsets
is null
or listSize <= 0
or hashSize <= 0
public HashTree(java.util.Vector itemsets)
itemsets
- the Vector of Itemsets that we should index
java.lang.IllegalArgumentException
- itemsets
is nullMethod Detail |
private void unvisitLeaves()
public void prepareForDescent()
private void prepare(HashTree.Node node)
private static int hash(int item, int level)
public void add(int index)
index
from Vector itemsets
which
was passed to the constructor of this HashTree.
index
- the index of the ARMinerItemset that we need to index in
this HashTree.private HashTree.Node add(HashTree.Node node, int level, int index)
public void update(ARMinerItemset row)
row
row
- the ARMinerItemset (normally a database row) against which
we test for inclusionprivate void update(HashTree.Node node, ARMinerItemset row, int index, int level)
public void update(ARMinerItemset row, long[][] counts)
row
and also update the matrix counts
row
- the ARMinerItemset (normally a database row) against which
we test for inclusioncounts
- a matrix used by some algorithms to speed up
computations; its rows correspond to Itemsets and its columns
correspond to items; each value in the matrix tells for how many
times had an item appeared together with an itemset in the rows
of the database.private void update(HashTree.Node node, ARMinerItemset row, int index, long[][] counts, int level)
public long countFrequentSubsets(ARMinerItemset itemset, long minWeight)
itemset
itemset
- the ARMinerItemset for which we count the subsetsminWeight
- the minimum weightprivate void countFrequentSubsets(HashTree.Node node, ARMinerItemset itemset, int index, long minWeight, int level)
public long countSubsets(ARMinerItemset itemset)
itemset
itemset
- the ARMinerItemset for which we count the subsetsprivate void countSubsets(HashTree.Node node, ARMinerItemset itemset, int index, int level)
public void checkLargeness(ARMinerItemset itemset)
itemset
.
If an ARMinerItemset is not large then it will be marked.
itemset
- the ARMinerItemset we checkprivate void checkLargeness(HashTree.Node node, ARMinerItemset itemset, int index, int level)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |