code: def chrom_auc_pr_score(
      target: np.ndarray,
      prediction: np.ndarray,
  ) -> Dict[str, float]:
      """Compute Area Under the PR Curve for abnormal.
  
      Args:
        target: Numpy array of targets of shape (n_samples, n_classes). Since this
          metric is only used for anomaly detection, we assume the n_classes is
          equal to 2.
        prediction: Numpy array of model predictions of shape (n_samples,
          n_classes). Here also we assume the n_classes is equal to 2.
  
      Returns:
        AUC PR score.
      """
      target = np.argmax(target, axis=-1)
  
      # In the prediction array, label 0 is for normal and 1 for abnormal examples.
      (
          pr_curve_precisions,
          pr_curve_recalls,
          _,
      ) = sklearn.metrics.precision_recall_curve(
          target, prediction[:, 1]
      )
      return {
          "chrom_auc_pr_score": sklearn.metrics.auc(
              pr_curve_recalls, pr_curve_precisions
          )
      }
  
file_path: scenic/scenic/projects/tasseo/train_utils.py
imports: from typing import Any, Dict, List, Optional
  from absl import logging
  import numpy
  import sklearn.metrics
label_desc: Use image node_id 1 for calling a global function with example usage: chrom_auc_pr_score(target, prediction) and returns: dict