code: def _eval_F1(self, seq_ref, seq_pred):
      # '''
      #     compute F1 score averaged over samples
      # '''
  
      precision_list = []
      recall_list = []
      f1_list = []
  
      for l, p in zip(seq_ref, seq_pred):
          label = set(l)
          prediction = set(p)
          true_positive = len(label.intersection(prediction))
          false_positive = len(prediction - label)
          false_negative = len(label - prediction)
  
          if true_positive + false_positive > 0:
              precision = true_positive / (
                  true_positive + false_positive
              )
          else:
              precision = 0
  
          if true_positive + false_negative > 0:
              recall = true_positive / (true_positive + false_negative)
          else:
              recall = 0
          if precision + recall > 0:
              f1 = 2 * precision * recall / (precision + recall)
          else:
              f1 = 0
  
          precision_list.append(precision)
          recall_list.append(recall)
          f1_list.append(f1)
  
      return {
          "precision": np.average(precision_list),
          "recall": np.average(recall_list),
          "F1": np.average(f1_list),
      }
  
file_path: ogb/ogb/graphproppred/evaluate.py
imports: import os
  import numpy
  import pandas
  from sklearn.metrics import roc_auc_score, average_precision_score
label_desc: Use image node_id 10 for calling the Evaluator obj's underlying member method code with example usage: obj._eval_F1(seq_ref, seq_pred) and returns: dict