code: def precision_recall_curve(
      y_true, probs_pred
  ) -> typing.Tuple[CumlArray, CumlArray, CumlArray]:
      """
      Compute precision-recall pairs for different probability thresholds
  
      .. note:: this implementation is restricted to the binary classification
          task. The precision is the ratio ``tp / (tp + fp)`` where ``tp`` is the
          number of true positives and ``fp`` the number of false positives. The
          precision is intuitively the ability of the classifier not to label as
          positive a sample that is negative.
  
          The recall is the ratio ``tp / (tp + fn)`` where ``tp`` is the number
          of true positives and ``fn`` the number of false negatives. The recall
          is intuitively the ability of the classifier to find all the positive
          samples. The last precision and recall values are 1. and 0.
          respectively and do not have a corresponding threshold. This ensures
          that the graph starts on the y axis.
  
          Read more in the scikit-learn's `User Guide
          <https://scikit-learn.org/stable/modules/model_evaluation.html#precision-recall-f-measure-metrics>`_.
  
  
      Parameters
      ----------
      y_true : array, shape = [n_samples]
          True binary labels, {0, 1}.
      probas_pred : array, shape = [n_samples]
          Estimated probabilities or decision function.
  
      Returns
      -------
      precision : array, shape = [n_thresholds + 1]
          Precision values such that element i is the precision of
          predictions with score >= thresholds[i] and the last element is 1.
      recall : array, shape = [n_thresholds + 1]
          Decreasing recall values such that element i is the recall of
          predictions with score >= thresholds[i] and the last element is 0.
      thresholds : array, shape = [n_thresholds <= len(np.unique(probas_pred))]
          Increasing thresholds on the decision function used to compute
          precision and recall.
  
      Examples
      --------
  
      .. code-block:: python
  
          >>> import cupy as cp
          >>> from cuml.metrics import precision_recall_curve
          >>> y_true = cp.array([0, 0, 1, 1])
          >>> y_scores = cp.array([0.1, 0.4, 0.35, 0.8])
          >>> precision, recall, thresholds = precision_recall_curve(
          ...     y_true, y_scores)
          >>> print(precision)
          [0.666... 0.5  1.  1. ]
          >>> print(recall)
          [1. 0.5 0.5 0. ]
          >>> print(thresholds)
          [0.35 0.4 0.8 ]
  
      """
      y_true, n_rows, n_cols, ytype = input_to_cupy_array(
          y_true,
          check_dtype=[np.int32, np.int64, np.float32, np.float64],
      )
  
      y_score, _, _, _ = input_to_cupy_array(
          probs_pred,
          check_dtype=[np.int32, np.int64, np.float32, np.float64],
          check_rows=n_rows,
          check_cols=n_cols,
      )
  
      if cp.any(y_true) == 0:
          raise ValueError(
              "precision_recall_curve cannot be used when "
              "y_true is all zero."
          )
  
      fps, tps, thresholds = _binary_clf_curve(y_true, y_score)
      precision = cp.flip(tps / (tps + fps), axis=0)
      recall = cp.flip(tps / tps[-1], axis=0)
      n = (recall == 1).sum()
  
      if n > 1:
          precision = precision[n - 1 :]
          recall = recall[n - 1 :]
          thresholds = thresholds[n - 1 :]
      precision = cp.concatenate([precision, cp.ones(1)])
      recall = cp.concatenate([recall, cp.zeros(1)])
  
      return precision, recall, thresholds
  
file_path: cuml/python/cuml/metrics/_ranking.py
imports: import math
  from cuml.internals.input_utils import input_to_cupy_array
  from cuml.internals.array import CumlArray
  import cuml.internals
  from cuml.internals.safe_imports import cpu_only_import
  import typing
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: precision_recall_curve(y_true, probs_pred) and returns: precision,  recall,  thresholds