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: Returns a set of frequent items. An item is determined to
  be frequent if there are atleast min_sup transactions that contains
  it. 
docstr_tok: ["Returns","a","set","of","frequent","items",".","An","item","is","determined","to","be","frequent","if","there","are","atleast","min_sup","transactions","that","contains","it","."]
code: def _get_frequent_items(self, transactions):
      """Returns a set of frequent items. An item is determined to
      be frequent if there are atleast min_sup transactions that contains
      it."""
      # Get all unique items in the transactions
      unique_items = set(
          item for transaction in transactions for item in transaction
      )
      items = []
      for item in unique_items:
          sup = self._calculate_support(item, transactions)
          if sup >= self.min_sup:
              items.append([item, sup])
      # Sort by support - Highest to lowest
      items.sort(key=lambda item: item[1], reverse=True)
      frequent_items = [[el[0]] for el in items]
      # Only return the items
      return frequent_items
  
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 3 for calling the FPGrowth obj's underlying member method code with example usage: obj._get_frequent_items(transactions) and returns: frequent_items