code: def mrr(
      y_pred: npt.NDArray[np.float32], y_true: npt.NDArray[np.float32]
  ) -> npt.NDArray[np.float32]:
      """
      Computes the mean reciprocal rank of the predictions.
  
      Args:
          y_pred: Array of shape [N, D] with the predictions (N: number of elements, D: number of
              metrics).
          y_true: Array of shape [N, D] with the true metrics.
  
      Returns:
          Array of shape [D] with the average MRR for each metric.
      """
      minimum_indices = y_pred.argmin(0)  # [D]
      true_ranks = st.rankdata(y_true, method="min", axis=0)  # [N, D]
      ranks = np.take_along_axis(
          true_ranks, minimum_indices[None, :], axis=0
      )  # [N, D]
      result = 1 / ranks
      return result.mean(0)
  
imports: import numpy
  import numpy.typing
  import scipy.stats
label_desc: Use image node_id 3 for calling a global function with example usage: mrr(y_pred, y_true) and returns: result