code: def interaction_f1(i_gt: Set[Tuple], i_hat: Set[Tuple], p: int):
      if len(i_gt) == 0:
          return
      recall = len(i_gt.intersection(i_hat)) / len(i_gt)
      precision = interaction_tpr(i_hat, i_gt, p)
      if recall + precision == 0:
          return 0
      return 2 * ((precision * recall) / (precision + recall))
  
file_path: imodels/imodels/util/tree_interaction_utils.py
imports: import itertools
  from typing import Set, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 8 for calling a global function with example usage: interaction_f1(i_gt, i_hat, p) and returns: unknown, int