class_docstr: Implementation of the Consistency metric which measures the expected local consistency, i.e., the probability
  of the prediction label for a given datapoint coinciding with the prediction labels of other data points that
  the same explanation is being attributed to. For example, if the explanation of a given image is "contains zebra",
  the local consistency metric measures the probability a different image that the explanation "contains zebra" is
  being attributed to having the same prediction label.
  
  Assumptions:
      - A used-defined discreization function is used to discretize continuous explanation spaces.
  
  References:
       1) Sanjoy Dasgupta et al.: "Framework for Evaluating Faithfulness of Local
          Explanations." ICML (2022): 4794-4815.
  
  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.
class_docstr_tok: ["Implementation","of","the","Consistency","metric","which","measures","the","expected","local","consistency",",","i.e.",",","the","probability","of","the","prediction","label","for","a","given","datapoint","coinciding","with","the","prediction","labels","of","other","data","points","that","the","same","explanation","is","being","attributed","to",".","For","example",",","if","the","explanation","of","a","given","image","is","``","contains","zebra","''",",","the","local","consistency","metric","measures","the","probability","a","different","image","that","the","explanation","``","contains","zebra","''","is","being","attributed","to","having","the","same","prediction","label",".","Assumptions",":","-","A","used-defined","discreization","function","is","used","to","discretize","continuous","explanation","spaces",".","References",":","1",")","Sanjoy","Dasgupta","et","al",".",":","``","Framework","for","Evaluating","Faithfulness","of","Local","Explanations",".","''","ICML","(","2022",")",":","4794-4815",".","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: This method performs XAI evaluation on a single batch of explanations.
  For more information on the specific logic, we refer the metric’s initialisation docstring.
  
  Parameters
  ----------
  a_batch:
      Batch of explanation to be evaluated.
  i_batch:
      Batch of segmentations to be evaluated.
  a_label_batch:
      Batch of discretised attribution labels.
  y_pred_classes:
      The class predictions of the complete input dataset.
  kwargs:
      Unused.
  
  Returns
  -------
  scores_batch:
      Evaluation results.
docstr_tok: ["This","method","performs","XAI","evaluation","on","a","single","batch","of","explanations",".","For","more","information","on","the","specific","logic",",","we","refer","the","metric","\u2019","s","initialisation","docstring",".","Parameters","--","--","--","--","--","a_batch",":","Batch","of","explanation","to","be","evaluated",".","i_batch",":","Batch","of","segmentations","to","be","evaluated",".","a_label_batch",":","Batch","of","discretised","attribution","labels",".","y_pred_classes",":","The","class","predictions","of","the","complete","input","dataset",".","kwargs",":","Unused",".","Returns","--","--","--","-","scores_batch",":","Evaluation","results","."]
code: def evaluate_batch(
      self,
      a_batch: np.ndarray,
      i_batch: np.ndarray,
      a_label_batch: np.ndarray,
      y_pred_classes: np.ndarray,
      **kwargs,
  ) -> List[float]:
      """
      This method performs XAI evaluation on a single batch of explanations.
      For more information on the specific logic, we refer the metric’s initialisation docstring.
  
      Parameters
      ----------
      a_batch:
          Batch of explanation to be evaluated.
      i_batch:
          Batch of segmentations to be evaluated.
      a_label_batch:
          Batch of discretised attribution labels.
      y_pred_classes:
          The class predictions of the complete input dataset.
      kwargs:
          Unused.
  
      Returns
      -------
      scores_batch:
          Evaluation results.
      """
  
      return [
          self.evaluate_instance(a, i, a_label, y_pred_classes)
          for a, i, a_label in zip(a_batch, i_batch, a_label_batch)
      ]
  
file_path: Quantus/quantus/metrics/robustness/consistency.py
imports: import sys
  from typing import Any, Callable, Dict, List, Optional, no_type_check
  import numpy
  from quantus.functions.discretise_func import top_n_sign
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.helpers import warn
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.metrics.base import Metric
label_desc: Use image node_id 5 for calling the Consistency obj's underlying member method code with example usage: obj.evaluate_batch(a_batch, i_batch, a_label_batch, y_pred_classes) and returns: unknown