class_docstr: Implementation of faithfulness correlation by Bhatt et al., 2020.
  
  The Faithfulness Correlation metric intend to capture an explanation's relative faithfulness
  (or 'fidelity') with respect to the model behaviour.
  
  Faithfulness correlation scores shows to what extent the predicted logits of each modified test point and
  the average explanation attribution for only the subset of features are (linearly) correlated, taking the
  average over multiple runs and test samples. The metric returns one float per input-attribution pair that
  ranges between -1 and 1, where higher scores are better.
  
  For each test sample, |S| features are randomly selected and replace them with baseline values (zero baseline
  or average of set). Thereafter, Pearson’s correlation coefficient between the predicted logits of each modified
  test point and the average explanation attribution for only the subset of features is calculated. Results is
  average over multiple runs and several test samples.
  
  References:
      1) Umang Bhatt et al.: "Evaluating and aggregating feature-based model
      explanations." IJCAI (2020): 3016-3022.
  
  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","faithfulness","correlation","by","Bhatt","et","al.",",","2020",".","The","Faithfulness","Correlation","metric","intend","to","capture","an","explanation","'s","relative","faithfulness","(","or","'fidelity","'",")","with","respect","to","the","model","behaviour",".","Faithfulness","correlation","scores","shows","to","what","extent","the","predicted","logits","of","each","modified","test","point","and","the","average","explanation","attribution","for","only","the","subset","of","features","are","(","linearly",")","correlated",",","taking","the","average","over","multiple","runs","and","test","samples",".","The","metric","returns","one","float","per","input-attribution","pair","that","ranges","between","-1","and","1",",","where","higher","scores","are","better",".","For","each","test","sample",",","|S|","features","are","randomly","selected","and","replace","them","with","baseline","values","(","zero","baseline","or","average","of","set",")",".","Thereafter",",","Pearson","\u2019","s","correlation","coefficient","between","the","predicted","logits","of","each","modified","test","point","and","the","average","explanation","attribution","for","only","the","subset","of","features","is","calculated",".","Results","is","average","over","multiple","runs","and","several","test","samples",".","References",":","1",")","Umang","Bhatt","et","al",".",":","``","Evaluating","and","aggregating","feature-based","model","explanations",".","''","IJCAI","(","2020",")",":","3016-3022",".","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
  ----------
  model: ModelInterface
      A ModelInterface that is subject to explanation.
  x_batch: np.ndarray
      The input to be evaluated on a batch-basis.
  y_batch: np.ndarray
      The output to be evaluated on a batch-basis.
  a_batch: np.ndarray
      The explanation to be evaluated on a batch-basis.
  kwargs:
      Unused.
  
  Returns
  -------
  scores_batch:
      The 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","--","--","--","--","--","model",":","ModelInterface","A","ModelInterface","that","is","subject","to","explanation",".","x_batch",":","np.ndarray","The","input","to","be","evaluated","on","a","batch-basis",".","y_batch",":","np.ndarray","The","output","to","be","evaluated","on","a","batch-basis",".","a_batch",":","np.ndarray","The","explanation","to","be","evaluated","on","a","batch-basis",".","kwargs",":","Unused",".","Returns","--","--","--","-","scores_batch",":","The","evaluation","results","."]
code: def evaluate_batch(
      self,
      model: ModelInterface,
      x_batch: np.ndarray,
      y_batch: np.ndarray,
      a_batch: 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
      ----------
      model: ModelInterface
          A ModelInterface that is subject to explanation.
      x_batch: np.ndarray
          The input to be evaluated on a batch-basis.
      y_batch: np.ndarray
          The output to be evaluated on a batch-basis.
      a_batch: np.ndarray
          The explanation to be evaluated on a batch-basis.
      kwargs:
          Unused.
  
      Returns
      -------
      scores_batch:
          The evaluation results.
      """
      return [
          self.evaluate_instance(model=model, x=x, y=y, a=a)
          for x, y, a in zip(x_batch, y_batch, a_batch)
      ]
  
file_path: Quantus/quantus/metrics/faithfulness/faithfulness_correlation.py
imports: import sys
  from typing import Any, Callable, Dict, List, Optional
  import numpy
  from quantus.functions.perturb_func import baseline_replacement_by_indices
  from quantus.functions.similarity_func import correlation_pearson
  from quantus.helpers import asserts, warn
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.helpers.perturbation_utils import make_perturb_func
  from quantus.metrics.base import Metric
label_desc: Use image node_id 5 for calling the FaithfulnessCorrelation obj's underlying member method code with example usage: obj.evaluate_batch(model, x_batch, y_batch, a_batch) and returns: unknown