wpi.associations.arminer
Class ARMinerApriori

java.lang.Object
  extended bywpi.associations.arminer.ARMinerApriori
All Implemented Interfaces:
LargeItemsetsFinder

public class ARMinerApriori
extends java.lang.Object
implements LargeItemsetsFinder

Apriori.java

This class implements the Apriori algorithm for finding large itemsets. (see "Fast Algorithms for Mining Association Rules" by Rakesh Agrawal and Ramakrishnan Srikant from IBM Almaden Research Center 1994)


Field Summary
private  DBCacheWriter cache_writer
           
private  java.util.Vector candidates
           
private  DBReader db_reader
           
private  HashTree ht_candidates
           
private  HashTree ht_k_frequent
           
private static int INITIAL_CAPACITY
           
private  java.util.Vector k_frequent
           
private  java.util.Vector large
           
private  long min_weight
           
private  long num_rows
           
private  int pass_num
           
 
Constructor Summary
ARMinerApriori()
           
 
Method Summary
private  void evaluateCandidates()
           
 int findLargeItemsets(DBReader dbReader, DBCacheWriter cacheWriter, float minSupport)
          Find the frequent itemsets in a database
private  void generateCandidates()
           
private  boolean getCandidate(int i, int j)
           
private  void weighCandidates()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values

candidates

private java.util.Vector candidates

k_frequent

private java.util.Vector k_frequent

large

private java.util.Vector large

ht_candidates

private HashTree ht_candidates

ht_k_frequent

private HashTree ht_k_frequent

pass_num

private int pass_num

db_reader

private DBReader db_reader

cache_writer

private DBCacheWriter cache_writer

num_rows

private long num_rows

min_weight

private long min_weight
Constructor Detail

ARMinerApriori

public ARMinerApriori()
Method Detail

findLargeItemsets

public int findLargeItemsets(DBReader dbReader,
                             DBCacheWriter cacheWriter,
                             float minSupport)
Find the frequent itemsets in a database

Specified by:
findLargeItemsets in interface LargeItemsetsFinder
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

weighCandidates

private void weighCandidates()

evaluateCandidates

private void evaluateCandidates()

generateCandidates

private void generateCandidates()

getCandidate

private boolean getCandidate(int i,
                             int j)