class_docstr: Area Under the ROC Curve (AUC).
  
  References
  ----------
  https://arxiv.org/ftp/arxiv/papers/1205/1205.2618.pdf
class_docstr_tok: ["Area","Under","the","ROC","Curve","(","AUC",")",".","References","--","--","--","--","--","https",":","\/\/arxiv.org\/ftp\/arxiv\/papers\/1205\/1205.2618.pdf"]
docstr: Compute Area Under the ROC Curve (AUC).
  
  Parameters
  ----------
  item_indices: Numpy array
      Items being considered for evaluation.
  
  pd_scores: Numpy array
      Prediction scores for items in item_indices.
  
  gt_pos: Numpy array
      Vector of positive items.
  
  gt_neg: Numpy array, optional
      Vector of negative items.
      If None, negation of gt_pos will be used.
  
  **kwargs: For compatibility
  
  Returns
  -------
  res: A scalar
      AUC score.
docstr_tok: ["Compute","Area","Under","the","ROC","Curve","(","AUC",")",".","Parameters","--","--","--","--","--","item_indices",":","Numpy","array","Items","being","considered","for","evaluation",".","pd_scores",":","Numpy","array","Prediction","scores","for","items","in","item_indices",".","gt_pos",":","Numpy","array","Vector","of","positive","items",".","gt_neg",":","Numpy","array",",","optional","Vector","of","negative","items",".","If","None",",","negation","of","gt_pos","will","be","used",".","*","*","kwargs",":","For","compatibility","Returns","--","--","--","-","res",":","A","scalar","AUC","score","."]
code: def compute(
      self, item_indices, pd_scores, gt_pos, gt_neg=None, **kwargs
  ):
      """Compute Area Under the ROC Curve (AUC).
  
      Parameters
      ----------
      item_indices: Numpy array
          Items being considered for evaluation.
  
      pd_scores: Numpy array
          Prediction scores for items in item_indices.
  
      gt_pos: Numpy array
          Vector of positive items.
  
      gt_neg: Numpy array, optional
          Vector of negative items.
          If None, negation of gt_pos will be used.
  
      **kwargs: For compatibility
  
      Returns
      -------
      res: A scalar
          AUC score.
  
      """
  
      gt_pos_mask = np.in1d(item_indices, gt_pos)
      gt_neg_mask = (
          np.logical_not(gt_pos_mask)
          if gt_neg is None
          else np.in1d(item_indices, gt_neg)
      )
  
      pos_scores = pd_scores[gt_pos_mask]
      neg_scores = pd_scores[gt_neg_mask]
      ui_scores = np.repeat(pos_scores, len(neg_scores))
      uj_scores = np.tile(neg_scores, len(pos_scores))
  
      return (ui_scores > uj_scores).sum() / len(uj_scores)
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 2 for calling the AUC obj's underlying member method code with example usage: obj.compute(item_indices, pd_scores, gt_pos, gt_neg) and returns: unknown