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"]
docstr: Recursive method that adds prefixes to the itemset by traversing the 
  FP Growth Tree
docstr_tok: ["Recursive","method","that","adds","prefixes","to","the","itemset","by","traversing","the","FP","Growth","Tree"]
code: def _determine_prefixes(self, itemset, node, prefixes=None):
      """Recursive method that adds prefixes to the itemset by traversing the
      FP Growth Tree"""
      if not prefixes:
          prefixes = []
  
      # If the current node is a prefix to the itemset
      # add the current prefixes value as prefix to the itemset
      if self._is_prefix(itemset, node):
          itemset_key = self._get_itemset_key(itemset)
          if not itemset_key in self.prefixes:
              self.prefixes[itemset_key] = []
          self.prefixes[itemset_key] += [
              {
                  "prefix": prefixes,
                  "support": node.children[itemset[0]].support,
              }
          ]
  
      for child_key in node.children:
          child = node.children[child_key]
          # Recursive call with child as new node. Add the child item as potential
          # prefix.
          self._determine_prefixes(
              itemset, child, prefixes + [child.item]
          )
  
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 8 for calling the FPGrowth obj's underlying member method code with example usage: obj._determine_prefixes(itemset, node, prefixes) without return types