class_docstr: This code is private in scikit-learn 0.24, so it is copied here.
class_docstr_tok: ["This","code","is","private","in","scikit-learn","0.24",",","so","it","is","copied","here","."]
docstr: Select the column of the positive label in `y_pred` when
  probabilities are provided.
  Parameters
  ----------
  y_pred : ndarray of shape (n_samples, n_classes)
      The prediction given by `predict_proba`.
  classes : ndarray of shape (n_classes,)
      The class labels for the estimator.
  Returns
  -------
  y_pred : ndarray of shape (n_samples,)
      Probability predictions of the positive class.
docstr_tok: ["Select","the","column","of","the","positive","label","in","`","y_pred","`","when","probabilities","are","provided",".","Parameters","--","--","--","--","--","y_pred",":","ndarray","of","shape","(","n_samples",",","n_classes",")","The","prediction","given","by","`","predict_proba","`",".","classes",":","ndarray","of","shape","(","n_classes",",",")","The","class","labels","for","the","estimator",".","Returns","--","--","--","-","y_pred",":","ndarray","of","shape","(","n_samples",",",")","Probability","predictions","of","the","positive","class","."]
code: def _select_proba_binary(self, y_pred, classes):
      """Select the column of the positive label in `y_pred` when
      probabilities are provided.
      Parameters
      ----------
      y_pred : ndarray of shape (n_samples, n_classes)
          The prediction given by `predict_proba`.
      classes : ndarray of shape (n_classes,)
          The class labels for the estimator.
      Returns
      -------
      y_pred : ndarray of shape (n_samples,)
          Probability predictions of the positive class.
      """
      if y_pred.shape[1] == 2:
          pos_label = self._kwargs.get("pos_label", classes[1])
          self._check_pos_label(pos_label, classes)
          col_idx = np.flatnonzero(classes == pos_label)[0]
          return y_pred[:, col_idx]
  
      err_msg = (
          f"Got predict_proba of shape {y_pred.shape}, but need "
          f"classifier with two classes for {self._score_func.__name__} "
          f"scoring"
      )
      raise ValueError(err_msg)
  
file_path: greykite/greykite/sklearn/sklearn_scorer.py
imports: import warnings
  from functools import partial
  import numpy
  from greykite.common.constants import PREDICTED_COL
label_desc: Use image node_id 3 for calling the _BaseScorer obj's underlying member method code with example usage: obj._select_proba_binary(y_pred, classes) and returns: y_pred