class_docstr: Evaluate for trained models.
docstr: Calculate the final results.
  :param rank_result_iter: results iter.
  :return: None
docstr_tok: ["Calculate","the","final","results",".",":","param","rank_result_iter",":","results","iter",".",":","return",":","None"]
code: def result(rank_result_iter):
      """
      Calculate the final results.
      :param rank_result_iter: results iter.
      :return: None
      """
      all_rank = [[], []]
      for data in rank_result_iter():
          for i in range(4):
              all_rank[i // 2].append(data[i])
  
      raw_rank = np.array(all_rank[0])
      filter_rank = np.array(all_rank[1])
      log.info("-----Raw-Average-Results")
      log.info(
          "MeanRank: {:.2f}, MRR: {:.4f}, Hits@1: {:.4f}, Hits@3: {:.4f}, Hits@10: {:.4f}".format(
              raw_rank.mean(),
              (1 / raw_rank).mean(),
              (raw_rank <= 1).mean(),
              (raw_rank <= 3).mean(),
              (raw_rank <= 10).mean(),
          )
      )
      log.info("-----Filter-Average-Results")
      log.info(
          "MeanRank: {:.2f}, MRR: {:.4f}, Hits@1: {:.4f}, Hits@3: {:.4f}, Hits@10: {:.4f}".format(
              filter_rank.mean(),
              (1 / filter_rank).mean(),
              (filter_rank <= 1).mean(),
              (filter_rank <= 3).mean(),
              (filter_rank <= 10).mean(),
          )
      )
  
file_path: PGL/legacy/examples/pgl-ke/evalutate.py
imports: import numpy
  import timeit
  from mp_mapper import mp_reader_mapper
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling the Evaluate obj's underlying member method code with example usage: obj.result(rank_result_iter) without return types