class_docstr: A method for determining frequent itemsets in a transactional database. 
  This is done by building a so called FP Growth tree, which can then be mined
  to collect the frequent itemsets. More effective than Apriori for large transactional
  databases.
  
  Parameters:
  -----------
  min_sup: float
      The minimum fraction of transactions an itemets needs to
      occur in to be deemed frequent
class_docstr_tok: ["A","method","for","determining","frequent","itemsets","in","a","transactional","database",".","This","is","done","by","building","a","so","called","FP","Growth","tree",",","which","can","then","be","mined","to","collect","the","frequent","itemsets",".","More","effective","than","Apriori","for","large","transactional","databases",".","Parameters",":","--","--","--","--","--","-","min_sup",":","float","The","minimum","fraction","of","transactions","an","itemets","needs","to","occur","in","to","be","deemed","frequent"]
code: def _determine_frequent_itemsets(self, conditional_database, suffix):
      # Calculate new frequent items from the conditional database
      # of suffix
      frequent_items = self._get_frequent_items(conditional_database)
  
      cond_tree = None
  
      if suffix:
          cond_tree = self._construct_tree(
              conditional_database, frequent_items
          )
          # Output new frequent itemset as the suffix added to the frequent
          # items
          self.frequent_itemsets += [
              el + suffix for el in frequent_items
          ]
  
      # Find larger frequent itemset by finding prefixes
      # of the frequent items in the FP Growth Tree for the conditional
      # database.
      self.prefixes = {}
      for itemset in frequent_items:
          # If no suffix (first run)
          if not cond_tree:
              cond_tree = self.tree_root
          # Determine prefixes to itemset
          self._determine_prefixes(itemset, cond_tree)
          conditional_database = []
          itemset_key = self._get_itemset_key(itemset)
          # Build new conditional database
          if itemset_key in self.prefixes:
              for el in self.prefixes[itemset_key]:
                  # If support = 4 => add 4 of the corresponding prefix set
                  for _ in range(el["support"]):
                      conditional_database.append(el["prefix"])
              # Create new suffix
              new_suffix = itemset + suffix if suffix else itemset
              self._determine_frequent_itemsets(
                  conditional_database, suffix=new_suffix
              )
  
file_path: ML-From-Scratch/mlfromscratch/unsupervised_learning/fp_growth.py
imports: from __future__ import division, print_function
  import numpy
  import itertools
label_desc: Use image node_id 10 for calling the FPGrowth obj's underlying member method code with example usage: obj._determine_frequent_itemsets(conditional_database, suffix) without return types