class_docstr: Class for black-box regressors.
docstr: Create a `Regressor` instance for a black-box model.
  
  :param predict_fn: Function that takes in an `np.ndarray` of input data and returns the predicted value for
         each input or a tuple of the form `(inputs, values)` containing the predicted value for each input.
  :param input_shape: Size of input.
  :param loss_fn: Function that takes in two `np.ndarray`s, of true values and predicted values, and returns the
         loss value for each pair.
  :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 values, 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","`","Regressor","`","instance","for","a","black-box","model",".",":","param","predict_fn",":","Function","that","takes","in","an","`","np.ndarray","`","of","input","data","and","returns","the","predicted","value","for","each","input","or","a","tuple","of","the","form","`","(","inputs",",","values",")","`","containing","the","predicted","value","for","each","input",".",":","param","input_shape",":","Size","of","input",".",":","param","loss_fn",":","Function","that","takes","in","two","`","np.ndarray","`","s",",","of","true","values","and","predicted","values",",","and","returns","the","loss","value","for","each","pair",".",":","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","values",",","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, ...],
      loss_fn: Optional[Callable] = None,
      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 `Regressor` instance for a black-box model.
  
      :param predict_fn: Function that takes in an `np.ndarray` of input data and returns the predicted value for
             each input or a tuple of the form `(inputs, values)` containing the predicted value for each input.
      :param input_shape: Size of input.
      :param loss_fn: Function that takes in two `np.ndarray`s, of true values and predicted values, and returns the
             loss value for each pair.
      :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 values, 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._fuzzy_float_compare = fuzzy_float_compare
      self._input_shape = input_shape
      self._loss_fn = loss_fn
  
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
  from art.estimators.regression.regressor import RegressorMixin, Regressor
  from art.estimators.classification import BlackBoxClassifier
label_desc: Use image node_id 1 to create a new BlackBoxRegressor object from inherited base classes: RegressorMixin, BaseEstimator with example: obj = BlackBoxRegressor(predict_fn, input_shape, loss_fn, clip_values, preprocessing_defences, postprocessing_defences, preprocessing, fuzzy_float_compare)