class_docstr: Method from Tran et al., 2018 performing poisoning detection based on Spectral Signatures
class_docstr_tok: ["Method","from","Tran","et","al.",",","2018","performing","poisoning","detection","based","on","Spectral","Signatures"]
docstr: Create an :class:`.SpectralSignatureDefense` object with the provided classifier.
  
  :param classifier: Model evaluated for poison.
  :param x_train: Dataset used to train the classifier.
  :param y_train: Labels used to train the classifier.
  :param expected_pp_poison: The expected percentage of poison in the dataset
  :param batch_size: The batch size for predictions
  :param eps_multiplier: The multiplier to add to the previous expectation. Numbers higher than one represent
                         a potentially higher false positive rate, but may detect more poison samples
docstr_tok: ["Create","an",":","class",":","`",".SpectralSignatureDefense","`","object","with","the","provided","classifier",".",":","param","classifier",":","Model","evaluated","for","poison",".",":","param","x_train",":","Dataset","used","to","train","the","classifier",".",":","param","y_train",":","Labels","used","to","train","the","classifier",".",":","param","expected_pp_poison",":","The","expected","percentage","of","poison","in","the","dataset",":","param","batch_size",":","The","batch","size","for","predictions",":","param","eps_multiplier",":","The","multiplier","to","add","to","the","previous","expectation",".","Numbers","higher","than","one","represent","a","potentially","higher","false","positive","rate",",","but","may","detect","more","poison","samples"]
code: def __init__(
      self,
      classifier: "CLASSIFIER_NEURALNETWORK_TYPE",
      x_train: np.ndarray,
      y_train: np.ndarray,
      expected_pp_poison: float = 0.33,
      batch_size: int = 128,
      eps_multiplier: float = 1.5,
  ) -> None:
      """
      Create an :class:`.SpectralSignatureDefense` object with the provided classifier.
  
      :param classifier: Model evaluated for poison.
      :param x_train: Dataset used to train the classifier.
      :param y_train: Labels used to train the classifier.
      :param expected_pp_poison: The expected percentage of poison in the dataset
      :param batch_size: The batch size for predictions
      :param eps_multiplier: The multiplier to add to the previous expectation. Numbers higher than one represent
                             a potentially higher false positive rate, but may detect more poison samples
      """
      super().__init__(classifier, x_train, y_train)
      self.classifier: "CLASSIFIER_NEURALNETWORK_TYPE" = classifier
      self.batch_size = batch_size
      self.eps_multiplier = eps_multiplier
      self.expected_pp_poison = expected_pp_poison
      self.y_train = y_train
      self.evaluator = GroundTruthEvaluator()
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/detector/poison/spectral_signature_defense.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from typing import List, Tuple, TYPE_CHECKING
  import numpy
  from art.defences.detector.poison.ground_truth_evaluator import GroundTruthEvaluator
  from art.defences.detector.poison.poison_filtering_defence import PoisonFilteringDefence
  from art.utils import segment_by_class
label_desc: Use image node_id 1 to create a new SpectralSignatureDefense object from inherited base classes: PoisonFilteringDefence with example: obj = SpectralSignatureDefense(classifier, x_train, y_train, expected_pp_poison, batch_size, eps_multiplier)