code: def _evaluate(self, eval_sampler):
      metric_results = {}
      for evaluator in self._eval_manager.evaluators:
          metric_results[evaluator.name] = []
  
      completed_user_count = 0
      pos_items, batch_data = eval_sampler.next_batch()
      while batch_data is not None:
          all_scores = []
          all_pos_items = []
          while len(batch_data) > 0:
              all_scores.append(
                  self._eval_iter_func(self._model, batch_data)
              )
              all_pos_items += pos_items
              pos_items, batch_data = eval_sampler.next_batch()
          result = self._eval_manager.full_eval(
              pos_samples=all_pos_items,
              excl_pos_samples=[],
              predictions=np.concatenate(all_scores, axis=0),
          )
          completed_user_count += 1
          print(
              "...Evaluated %d users" % completed_user_count, end="\r"
          )
          for key in result:
              metric_results[key].append(result[key])
          pos_items, batch_data = eval_sampler.next_batch()
  
      return metric_results
  
file_path: openrec/openrec/tf1/model_trainer.py
imports: from __future__ import print_function
  from openrec.tf1.utils.evaluators import EvalManager
  from termcolor import colored
  import sys
  import numpy
label_desc: Use image node_id 4 for calling the ModelTrainer obj's underlying member method code with example usage: obj._evaluate(eval_sampler) and returns: metric_results