Class FrequentPatternTree<T>

java.lang.Object
org.tweetyproject.machinelearning.assoc.FrequentPatternTree<T>
Type Parameters:
T - the type of items

public class FrequentPatternTree<T> extends Object
Implements the an FP-Tree for the FP-Growth Algorithm for frequent pattern mining, cf. [Jiawei Han, Jian Pei, Yiwen Yin. Mining frequent patterns without candidate generation. ACM SIGMOD Record, Volume 29, Issue 2, June 2000 pp 1–12]
Author:
Matthias Thimm
  • Constructor Details

    • FrequentPatternTree

      public FrequentPatternTree(Collection<Collection<T>> database, double minsupport)
      Creates an FP-Tree for the given database with the given minimal support.
      Parameters:
      database - some set of transactions
      minsupport - minimal support
  • Method Details

    • extractFrequentPatterns

      public Collection<Collection<T>> extractFrequentPatterns()
      Extracts all frequent patterns from this tree.
      Returns:
      the set of all frequent patterns from this tree
    • extractFrequentPatterns

      public Collection<Collection<T>> extractFrequentPatterns(Collection<T> prefix)
      Extracts all frequent patterns from this tree plus prefix.
      Parameters:
      prefix - items to be added to each set.
      Returns:
      the set of all frequent patterns from this tree plus prefix.
    • toString

      public String toString()
      Overrides:
      toString in class Object