org.apache.mahout.fpm.pfpgrowth.fpgrowth
Class FPGrowth<A extends Comparable<? super A>>

java.lang.Object
  extended by org.apache.mahout.fpm.pfpgrowth.fpgrowth.FPGrowth<A>
Type Parameters:
A - object type used as the cell items in a transaction list

public class FPGrowth<A extends Comparable<? super A>>
extends Object

Implementation of PFGrowth Algorithm with FP-Bonsai pruning


Constructor Summary
FPGrowth()
           
 
Method Summary
 List<Pair<A,Long>> generateFList(Iterator<Pair<List<A>,Long>> transactions, int minSupport)
          Generate the Feature Frequency list from the given transaction whose frequency > minSupport
 void generateTopKFrequentPatterns(Iterator<Pair<List<A>,Long>> transactionStream, Collection<Pair<A,Long>> frequencyList, long minSupport, int k, Collection<A> returnableFeatures, org.apache.hadoop.mapred.OutputCollector<A,List<Pair<List<A>,Long>>> output, StatusUpdater updater)
          Generate Top K Frequent Patterns for every feature in returnableFeatures given a stream of transactions and the minimum support
static List<Pair<String,TopKStringPatterns>> readFrequentPattern(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FPGrowth

public FPGrowth()
Method Detail

readFrequentPattern

public static List<Pair<String,TopKStringPatterns>> readFrequentPattern(org.apache.hadoop.conf.Configuration conf,
                                                                        org.apache.hadoop.fs.Path path)

generateFList

public final List<Pair<A,Long>> generateFList(Iterator<Pair<List<A>,Long>> transactions,
                                              int minSupport)
Generate the Feature Frequency list from the given transaction whose frequency > minSupport

Parameters:
transactions - Iterator over the transaction database
minSupport - minSupport of the feature to be included
Returns:
the List of features and their associated frequency as a Pair

generateTopKFrequentPatterns

public final void generateTopKFrequentPatterns(Iterator<Pair<List<A>,Long>> transactionStream,
                                               Collection<Pair<A,Long>> frequencyList,
                                               long minSupport,
                                               int k,
                                               Collection<A> returnableFeatures,
                                               org.apache.hadoop.mapred.OutputCollector<A,List<Pair<List<A>,Long>>> output,
                                               StatusUpdater updater)
                                        throws IOException
Generate Top K Frequent Patterns for every feature in returnableFeatures given a stream of transactions and the minimum support

Parameters:
transactionStream - Iterator of transaction
frequencyList - list of frequent features and their support value
minSupport - minimum support of the transactions
k - Number of top frequent patterns to keep
returnableFeatures - set of features for which the frequent patterns are mined. If the set is empty or null, then top K patterns for every frequent item (an item whose support> minSupport) is generated
output - The output collector to which the the generated patterns are written
Throws:
IOException


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.