class_docstr: Implementation of Completeness test by Sundararajan et al., 2017, also referred
  to as Summation to Delta by Shrikumar et al., 2017 and Conservation by
  Montavon et al., 2018.
  
  Attribution completeness asks that the total attribution is proportional to the explainable
  evidence at the output/ or some function of the model output. Or, that the attributions
  add up to the difference between the model output F at the input x and the baseline b.
  
  Assumptions:
      - This implementation does completeness test against logits, not softmax.
  
  References:
      1) Completeness - Mukund Sundararajan et al.: "Axiomatic attribution for deep networks."
      International Conference on Machine Learning. PMLR, 2017.
      2) Summation to delta - Avanti Shrikumar et al.: "Learning important
      features through propagating activation differences." International Conference on Machine Learning. PMLR, 2017.
      3) Conservation - Grégoire Montavon et al.: "Methods for interpreting
      and understanding deep neural networks." Digital Signal Processing 73 (2018): 1-15.
  
  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.
docstr: Evaluate instance gets model and data for a single instance as input and returns the evaluation result.
  
  Parameters
  ----------
  model: ModelInterface
      A ModelInteface that is subject to explanation.
  x: np.ndarray
      The input to be evaluated on an instance-basis.
  y: np.ndarray
      The output to be evaluated on an instance-basis.
  a: np.ndarray
      The explanation to be evaluated on an instance-basis.
  
  Returns
  -------
  score: boolean
      The evaluation results.
docstr_tok: ["Evaluate","instance","gets","model","and","data","for","a","single","instance","as","input","and","returns","the","evaluation","result",".","Parameters","--","--","--","--","--","model",":","ModelInterface","A","ModelInteface","that","is","subject","to","explanation",".","x",":","np.ndarray","The","input","to","be","evaluated","on","an","instance-basis",".","y",":","np.ndarray","The","output","to","be","evaluated","on","an","instance-basis",".","a",":","np.ndarray","The","explanation","to","be","evaluated","on","an","instance-basis",".","Returns","--","--","--","-","score",":","boolean","The","evaluation","results","."]
code: def evaluate_instance(
      self,
      model: ModelInterface,
      x: np.ndarray,
      y: np.ndarray,
      a: np.ndarray,
  ) -> bool:
      """
      Evaluate instance gets model and data for a single instance as input and returns the evaluation result.
  
      Parameters
      ----------
      model: ModelInterface
          A ModelInteface that is subject to explanation.
      x: np.ndarray
          The input to be evaluated on an instance-basis.
      y: np.ndarray
          The output to be evaluated on an instance-basis.
      a: np.ndarray
          The explanation to be evaluated on an instance-basis.
  
      Returns
      -------
      score: boolean
          The evaluation results.
      """
      x_baseline = self.perturb_func(
          arr=x,
          indices=np.arange(0, x.size),
          indexed_axes=np.arange(0, x.ndim),
      )
  
      # Predict on input.
      x_input = model.shape_input(x, x.shape, channel_first=True)
      y_pred = float(model.predict(x_input)[:, y])
  
      # Predict on baseline.
      x_input = model.shape_input(
          x_baseline, x.shape, channel_first=True
      )
      y_pred_baseline = float(model.predict(x_input)[:, y])
  
      if np.sum(a) == self.output_func(y_pred - y_pred_baseline):
          return True
      else:
          return False
  
file_path: Quantus/quantus/metrics/axiomatic/completeness.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.helpers import 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
  from quantus.helpers.utils import identity
label_desc: Use image node_id 3 for calling the Completeness obj's underlying member method code with example usage: obj.evaluate_instance(model, x, y, a) and returns: True, False