class_docstr: Mean average precision metric.
docstr: Calculate mean average precision.
  
  Example:
      >>> y_true = [0, 1, 0, 0]
      >>> y_pred = [0.1, 0.6, 0.2, 0.3]
      >>> MeanAveragePrecision()(y_true, y_pred)
      1.0
  
  :param y_true: The ground true label of each document.
  :param y_pred: The predicted scores of each document.
  :return: Mean average precision.
docstr_tok: ["Calculate","mean","average","precision",".","Example",":",">",">",">","y_true","=","[","0",",","1",",","0",",","0","]",">",">",">","y_pred","=","[","0.1",",","0.6",",","0.2",",","0.3","]",">",">",">","MeanAveragePrecision","(",")","(","y_true",",","y_pred",")","1.0",":","param","y_true",":","The","ground","true","label","of","each","document",".",":","param","y_pred",":","The","predicted","scores","of","each","document",".",":","return",":","Mean","average","precision","."]
code: def __call__(self, y_true: np.array, y_pred: np.array) -> float:
      """
      Calculate mean average precision.
  
      Example:
          >>> y_true = [0, 1, 0, 0]
          >>> y_pred = [0.1, 0.6, 0.2, 0.3]
          >>> MeanAveragePrecision()(y_true, y_pred)
          1.0
  
      :param y_true: The ground true label of each document.
      :param y_pred: The predicted scores of each document.
      :return: Mean average precision.
      """
      result = 0.0
      pos = 0
      coupled_pair = sort_and_couple(y_true, y_pred)
      for idx, (label, score) in enumerate(coupled_pair):
          if label > self._threshold:
              pos += 1.0
              result += pos / (idx + 1.0)
      if pos == 0:
          return 0.0
      else:
          return result / pos
  
imports: import numpy
  from matchzoo.engine.base_metric import BaseMetric, sort_and_couple
label_desc: Use image node_id 3 for calling the MeanAveragePrecision obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: int, unknown