code: def calc_f1(y_true, y_pred):
      if not FLAGS.sigmoid:
          y_true = np.argmax(y_true, axis=1)
          y_pred = np.argmax(y_pred, axis=1)
      else:
          y_pred[y_pred > 0.5] = 1
          y_pred[y_pred <= 0.5] = 0
      return metrics.f1_score(
          y_true, y_pred, average="micro"
      ), metrics.f1_score(y_true, y_pred, average="macro")
  
file_path: GraphSAGE/graphsage/supervised_train.py
imports: from __future__ import division
  from __future__ import print_function
  import os
  import time
  import tensorflow
  import numpy
  import sklearn
  from sklearn import metrics
  from graphsage.supervised_models import SupervisedGraphsage
  from graphsage.models import SAGEInfo
  from graphsage.minibatch import NodeMinibatchIterator
  from graphsage.neigh_samplers import UniformNeighborSampler
  from graphsage.utils import load_data
label_desc: Use image node_id 1 for calling a global function with example usage: calc_f1(y_true, y_pred) and returns: metrics,  metrics