class_docstr: Mean reciprocal rank metric.
docstr: Calculate reciprocal of the rank of the first relevant item.
  
  Example:
      >>> import numpy as np
      >>> y_pred = np.asarray([0.2, 0.3, 0.7, 1.0])
      >>> y_true = np.asarray([1, 0, 0, 0])
      >>> MeanReciprocalRank()(y_true, y_pred)
      0.25
  
  :param y_true: The ground true label of each document.
  :param y_pred: The predicted scores of each document.
  :return: Mean reciprocal rank.
docstr_tok: ["Calculate","reciprocal","of","the","rank","of","the","first","relevant","item",".","Example",":",">",">",">","import","numpy","as","np",">",">",">","y_pred","=","np.asarray","(","[","0.2",",","0.3",",","0.7",",","1.0","]",")",">",">",">","y_true","=","np.asarray","(","[","1",",","0",",","0",",","0","]",")",">",">",">","MeanReciprocalRank","(",")","(","y_true",",","y_pred",")","0.25",":","param","y_true",":","The","ground","true","label","of","each","document",".",":","param","y_pred",":","The","predicted","scores","of","each","document",".",":","return",":","Mean","reciprocal","rank","."]
code: def __call__(self, y_true: np.array, y_pred: np.array) -> float:
      """
      Calculate reciprocal of the rank of the first relevant item.
  
      Example:
          >>> import numpy as np
          >>> y_pred = np.asarray([0.2, 0.3, 0.7, 1.0])
          >>> y_true = np.asarray([1, 0, 0, 0])
          >>> MeanReciprocalRank()(y_true, y_pred)
          0.25
  
      :param y_true: The ground true label of each document.
      :param y_pred: The predicted scores of each document.
      :return: Mean reciprocal rank.
      """
      coupled_pair = sort_and_couple(y_true, y_pred)
      for idx, (label, pred) in enumerate(coupled_pair):
          if label > self._threshold:
              return 1.0 / (idx + 1)
      return 0.0
  
imports: import numpy
  from matchzoo.engine.base_metric import BaseMetric, sort_and_couple
label_desc: Use image node_id 3 for calling the MeanReciprocalRank obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: int, unknown