class_docstr: Implement the thermometer encoding defence approach.
  
  | Paper link: https://openreview.net/forum?id=S18Su--CW
  
  | Please keep in mind the limitations of defences. For more information on the limitations of this defence,
      see https://arxiv.org/abs/1802.00420 . For details on how to evaluate classifier security in general, see
      https://arxiv.org/abs/1902.06705
docstr: Create an instance of thermometer encoding.
  
  :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
         for features.
  :param num_space: Number of evenly spaced levels within the interval of minimum and maximum clip values.
  :param channels_first: Set channels first or last.
  :param apply_fit: True if applied during fitting/training.
  :param apply_predict: True if applied during predicting.
docstr_tok: ["Create","an","instance","of","thermometer","encoding",".",":","param","clip_values",":","Tuple","of","the","form","`","(","min",",","max",")","`","representing","the","minimum","and","maximum","values","allowed","for","features",".",":","param","num_space",":","Number","of","evenly","spaced","levels","within","the","interval","of","minimum","and","maximum","clip","values",".",":","param","channels_first",":","Set","channels","first","or","last",".",":","param","apply_fit",":","True","if","applied","during","fitting\/training",".",":","param","apply_predict",":","True","if","applied","during","predicting","."]
code: def __init__(
      self,
      clip_values: "CLIP_VALUES_TYPE",
      num_space: int = 10,
      channels_first: bool = False,
      apply_fit: bool = True,
      apply_predict: bool = True,
  ) -> None:
      """
      Create an instance of thermometer encoding.
  
      :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
             for features.
      :param num_space: Number of evenly spaced levels within the interval of minimum and maximum clip values.
      :param channels_first: Set channels first or last.
      :param apply_fit: True if applied during fitting/training.
      :param apply_predict: True if applied during predicting.
      """
      super().__init__(
          is_fitted=True,
          apply_fit=apply_fit,
          apply_predict=apply_predict,
      )
      self.clip_values = clip_values
      self.num_space = num_space
      self.channels_first = channels_first
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/thermometer_encoding.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from art.config import ART_NUMPY_DTYPE
  from art.defences.preprocessor.preprocessor import Preprocessor
  from art.utils import to_categorical
label_desc: Use image node_id 1 to create a new ThermometerEncoding object from inherited base classes: Preprocessor with example: obj = ThermometerEncoding(clip_values, num_space, channels_first, apply_fit, apply_predict)