code: def auc_nt(
      y_true: Union[List[int], np.ndarray],
      y_score: Union[List[float], np.ndarray],
  ) -> float:
      """Compute Area Under the Negative Predictive Value vs. True Negative Rate Curve (NT AUC) from prediction scores.
  
      This metric can be thought of as a PR AUC in which errors are treated as positives.
  
      Note: If only positives are present in y_true, 0.0 is returned.
      """
      y_true = np.array(y_true)
      y_score = np.array(y_score)
      assert len(y_true) == len(y_score)
      assert np.all(y_true >= 0) and np.all(y_true <= 1)
      if np.all(y_true == 1):
          return 0.0
      return average_precision_score(1 - y_true, 1 - y_score)
  
file_path: NeMo/nemo/collections/asr/parts/utils/confidence_metrics.py
imports: import math
  import os
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from sklearn.metrics import PrecisionRecallDisplay, RocCurveDisplay, average_precision_score, log_loss, precision_recall_curve, roc_auc_score, roc_curve
label_desc: Use image node_id 3 for calling a global function with example usage: auc_nt(y_true, y_score) and returns: average_precision_score, int