class_docstr: Class for black-box classifiers.
docstr: Create a `Classifier` instance for a black-box model.
  
  :param predict_fn: Function that takes in an `np.ndarray` of input data and returns the one-hot encoded matrix
         of predicted classes or tuple of the form `(inputs, labels)` containing the predicted labels for each
         input.
  :param input_shape: Size of input.
  :param nb_classes: Number of prediction classes.
  :param clip_values: Tuple of the form `(min, max)` of floats or `np.ndarray` representing the minimum and
         maximum values allowed for features. If floats are provided, these will be used as the range of all
         features. If arrays are provided, each value will be considered the bound for a feature, thus
         the shape of clip values needs to match the total number of features.
  :param preprocessing_defences: Preprocessing defence(s) to be applied by the classifier.
  :param postprocessing_defences: Postprocessing defence(s) to be applied by the classifier.
  :param preprocessing: Tuple of the form `(subtrahend, divisor)` of floats or `np.ndarray` of values to be
         used for data preprocessing. The first value will be subtracted from the input. The input will then
         be divided by the second one.
  :param fuzzy_float_compare: If `predict_fn` is a tuple mapping inputs to labels, and this is True, looking up
         inputs in the table will be done using `numpy.isclose`. Only set to True if really needed, since this
         severely affects performance.
docstr_tok: ["Create","a","`","Classifier","`","instance","for","a","black-box","model",".",":","param","predict_fn",":","Function","that","takes","in","an","`","np.ndarray","`","of","input","data","and","returns","the","one-hot","encoded","matrix","of","predicted","classes","or","tuple","of","the","form","`","(","inputs",",","labels",")","`","containing","the","predicted","labels","for","each","input",".",":","param","input_shape",":","Size","of","input",".",":","param","nb_classes",":","Number","of","prediction","classes",".",":","param","clip_values",":","Tuple","of","the","form","`","(","min",",","max",")","`","of","floats","or","`","np.ndarray","`","representing","the","minimum","and","maximum","values","allowed","for","features",".","If","floats","are","provided",",","these","will","be","used","as","the","range","of","all","features",".","If","arrays","are","provided",",","each","value","will","be","considered","the","bound","for","a","feature",",","thus","the","shape","of","clip","values","needs","to","match","the","total","number","of","features",".",":","param","preprocessing_defences",":","Preprocessing","defence","(","s",")","to","be","applied","by","the","classifier",".",":","param","postprocessing_defences",":","Postprocessing","defence","(","s",")","to","be","applied","by","the","classifier",".",":","param","preprocessing",":","Tuple","of","the","form","`","(","subtrahend",",","divisor",")","`","of","floats","or","`","np.ndarray","`","of","values","to","be","used","for","data","preprocessing",".","The","first","value","will","be","subtracted","from","the","input",".","The","input","will","then","be","divided","by","the","second","one",".",":","param","fuzzy_float_compare",":","If","`","predict_fn","`","is","a","tuple","mapping","inputs","to","labels",",","and","this","is","True",",","looking","up","inputs","in","the","table","will","be","done","using","`","numpy.isclose","`",".","Only","set","to","True","if","really","needed",",","since","this","severely","affects","performance","."]
code: def __init__(
      self,
      predict_fn: Union[Callable, Tuple[np.ndarray, np.ndarray]],
      input_shape: Tuple[int, ...],
      nb_classes: int,
      clip_values: Optional["CLIP_VALUES_TYPE"] = None,
      preprocessing_defences: Union[
          "Preprocessor", List["Preprocessor"], None
      ] = None,
      postprocessing_defences: Union[
          "Postprocessor", List["Postprocessor"], None
      ] = None,
      preprocessing: "PREPROCESSING_TYPE" = (0.0, 1.0),
      fuzzy_float_compare: bool = False,
  ):
      """
      Create a `Classifier` instance for a black-box model.
  
      :param predict_fn: Function that takes in an `np.ndarray` of input data and returns the one-hot encoded matrix
             of predicted classes or tuple of the form `(inputs, labels)` containing the predicted labels for each
             input.
      :param input_shape: Size of input.
      :param nb_classes: Number of prediction classes.
      :param clip_values: Tuple of the form `(min, max)` of floats or `np.ndarray` representing the minimum and
             maximum values allowed for features. If floats are provided, these will be used as the range of all
             features. If arrays are provided, each value will be considered the bound for a feature, thus
             the shape of clip values needs to match the total number of features.
      :param preprocessing_defences: Preprocessing defence(s) to be applied by the classifier.
      :param postprocessing_defences: Postprocessing defence(s) to be applied by the classifier.
      :param preprocessing: Tuple of the form `(subtrahend, divisor)` of floats or `np.ndarray` of values to be
             used for data preprocessing. The first value will be subtracted from the input. The input will then
             be divided by the second one.
      :param fuzzy_float_compare: If `predict_fn` is a tuple mapping inputs to labels, and this is True, looking up
             inputs in the table will be done using `numpy.isclose`. Only set to True if really needed, since this
             severely affects performance.
      """
      super().__init__(
          model=None,
          clip_values=clip_values,
          preprocessing_defences=preprocessing_defences,
          postprocessing_defences=postprocessing_defences,
          preprocessing=preprocessing,
      )
      if callable(predict_fn):
          self._predict_fn = predict_fn
      else:
          self._predict_fn = _make_lookup_predict_fn(
              predict_fn, fuzzy_float_compare
          )
      self._input_shape = input_shape
      self.nb_classes = nb_classes
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from functools import total_ordering
  import logging
  from typing import Callable, List, Optional, Union, Tuple, TYPE_CHECKING
  import numpy
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin, Classifier
label_desc: Use image node_id 1 to create a new BlackBoxClassifier object from inherited base classes: ClassifierMixin, BaseEstimator with example: obj = BlackBoxClassifier(predict_fn, input_shape, nb_classes, clip_values, preprocessing_defences, postprocessing_defences, preprocessing, fuzzy_float_compare)