class_docstr: Implementation of AUC metric by Fawcett et al., 2006.
  
  AUC is a ranking metric and  compares the ranking between attributions and a given ground-truth mask
  
  References:
      1) Tom Fawcett: 'An introduction to ROC analysis' "Pattern Recognition Letters" Vol 27, Issue 8, 2006
  
  Attributes:
      -  _name: The name of the metric.
      - _data_applicability: The data types that the metric implementation currently supports.
      - _models: The model types that this metric can work with.
      - score_direction: How to interpret the scores, whether higher/ lower values are considered better.
      - evaluation_category: What property/ explanation quality that this metric measures.
docstr: Evaluate instance gets model and data for a single instance as input and returns the evaluation result.
  
  Parameters
  ----------
  a: np.ndarray
      The explanation to be evaluated on an instance-basis.
  s: np.ndarray
      The segmentation to be evaluated on an instance-basis.
  
  Returns
  -------
  : float
   The evaluation results.
docstr_tok: ["Evaluate","instance","gets","model","and","data","for","a","single","instance","as","input","and","returns","the","evaluation","result",".","Parameters","--","--","--","--","--","a",":","np.ndarray","The","explanation","to","be","evaluated","on","an","instance-basis",".","s",":","np.ndarray","The","segmentation","to","be","evaluated","on","an","instance-basis",".","Returns","--","--","--","-",":","float","The","evaluation","results","."]
code: def evaluate_instance(a: np.ndarray, s: np.ndarray) -> float:
      """
      Evaluate instance gets model and data for a single instance as input and returns the evaluation result.
  
      Parameters
      ----------
      a: np.ndarray
          The explanation to be evaluated on an instance-basis.
      s: np.ndarray
          The segmentation to be evaluated on an instance-basis.
  
      Returns
      -------
      : float
       The evaluation results.
      """
      # Return np.nan as result if segmentation map is empty.
      if np.sum(s) == 0:
          warn.warn_empty_segmentation()
          return np.nan
  
      # Prepare shapes.
      a = a.flatten()
      s = s.flatten().astype(bool)
  
      fpr, tpr, _ = roc_curve(y_true=s, y_score=a)
      score = auc(x=fpr, y=tpr)
  
      return score
  
file_path: Quantus/quantus/metrics/localisation/auc.py
imports: import sys
  from typing import Any, Callable, Dict, List, Optional
  import numpy
  from sklearn.metrics import auc, roc_curve
  from quantus.helpers import asserts, warn
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.metrics.base import Metric
label_desc: Use image node_id 3 for calling the AUC obj's underlying member method code with example usage: obj.evaluate_instance(a, s) and returns: score, np