docstr: Creates and returns the subtree of self conditioned on cond_item.
  
  Parameters
  ----------
  cond_item : int | str
      Item that the tree (self) will be conditioned on.
  minsup : int
      Minimum support threshold.
  
  Returns
  -------
  cond_tree : FPtree
docstr_tok: ["Creates","and","returns","the","subtree","of","self","conditioned","on","cond_item",".","Parameters","--","--","--","--","--","cond_item",":","int","|","str","Item","that","the","tree","(","self",")","will","be","conditioned","on",".","minsup",":","int","Minimum","support","threshold",".","Returns","--","--","--","-","cond_tree",":","FPtree"]
code: def conditional_tree(self, cond_item, minsup):
      """
      Creates and returns the subtree of self conditioned on cond_item.
  
      Parameters
      ----------
      cond_item : int | str
          Item that the tree (self) will be conditioned on.
      minsup : int
          Minimum support threshold.
  
      Returns
      -------
      cond_tree : FPtree
      """
      # Find all path from root node to nodes for item
      branches = []
      count = collections.defaultdict(int)
      for node in self.nodes[cond_item]:
          branch = node.itempath_from_root()
          branches.append(branch)
          for item in branch:
              count[item] += node.count
  
      # Define new ordering or deep trees may have combinatorially explosion
      items = [item for item in count if count[item] >= minsup]
      items.sort(key=count.get)
      rank = {item: i for i, item in enumerate(items)}
  
      # Create conditional tree
      cond_tree = FPTree(rank)
      for idx, branch in enumerate(branches):
          branch = sorted(
              [i for i in branch if i in rank],
              key=rank.get,
              reverse=True,
          )
          cond_tree.insert_itemset(
              branch, self.nodes[cond_item][idx].count
          )
      cond_tree.cond_items = self.cond_items + [cond_item]
  
      return cond_tree
  
file_path: mlxtend/mlxtend/frequent_patterns/fpcommon.py
imports: import collections
  import warnings
  import numpy
  import pandas
  from pandas import __version__
label_desc: Use image node_id 2 for calling the FPTree obj's underlying member method code with example usage: obj.conditional_tree(cond_item, minsup) and returns: cond_tree