class_docstr: this is modified from `howto100m/metrics.py`.
  History of changes:
  refactor as a class.
  add metric_key in __init__
class_docstr_tok: ["this","is","modified","from","`","howto100m\/metrics.py","`",".","History","of","changes",":","refactor","as","a","class",".","add","metric_key","in","__init__"]
code: def print_computed_metrics(self, metrics):
      r1 = metrics["R1"]
      r5 = metrics["R5"]
      r10 = metrics["R10"]
      mr = metrics["MR"]
      print(
          "R@1: {:.4f} - R@5: {:.4f} - R@10: {:.4f} - Median R: {}".format(
              r1, r5, r10, mr
          )
      )
      if "error" in metrics:
          print(metrics["error"])
  
imports: import numpy
  import json
label_desc: Use image node_id 3 for calling the RetrievalMetric obj's underlying member method code with example usage: obj.print_computed_metrics(metrics) without return types