class_docstr: Class for importing XGBoost models.
docstr: Create a `Classifier` instance from a XGBoost model.
  
  :param model: XGBoost model.
  :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
         for 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 nb_features: The number of features in the training data. Only used if it cannot be extracted from
                       model.
  :param nb_classes: The number of classes in the training data. Only used if it cannot be extracted from model.
docstr_tok: ["Create","a","`","Classifier","`","instance","from","a","XGBoost","model",".",":","param","model",":","XGBoost","model",".",":","param","clip_values",":","Tuple","of","the","form","`","(","min",",","max",")","`","representing","the","minimum","and","maximum","values","allowed","for","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","nb_features",":","The","number","of","features","in","the","training","data",".","Only","used","if","it","can","not","be","extracted","from","model",".",":","param","nb_classes",":","The","number","of","classes","in","the","training","data",".","Only","used","if","it","can","not","be","extracted","from","model","."]
code: def __init__(
      self,
      model: Union[
          "xgboost.Booster", "xgboost.XGBClassifier", None
      ] = 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),
      nb_features: Optional[int] = None,
      nb_classes: Optional[int] = None,
  ) -> None:
      """
      Create a `Classifier` instance from a XGBoost model.
  
      :param model: XGBoost model.
      :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
             for 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 nb_features: The number of features in the training data. Only used if it cannot be extracted from
                           model.
      :param nb_classes: The number of classes in the training data. Only used if it cannot be extracted from model.
      """
      from xgboost import Booster, XGBClassifier
  
      if not isinstance(model, Booster) and not isinstance(
          model, XGBClassifier
      ):
          raise TypeError(
              "Model must be of type xgboost.Booster or xgboost.XGBClassifier."
          )
  
      super().__init__(
          model=model,
          clip_values=clip_values,
          preprocessing_defences=preprocessing_defences,
          postprocessing_defences=postprocessing_defences,
          preprocessing=preprocessing,
      )
      self._input_shape = (nb_features,)
      _nb_classes = self._get_nb_classes(nb_classes)
      if _nb_classes is not None:
          self._nb_classes = _nb_classes
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from copy import deepcopy
  import json
  import logging
  import os
  import pickle
  from typing import List, Optional, Union, Tuple, TYPE_CHECKING
  import numpy
  from art.estimators.classification.classifier import ClassifierDecisionTree
  from art.utils import to_categorical
  from art import config
label_desc: Use image node_id 1 to create a new XGBoostClassifier object from inherited base classes: ClassifierDecisionTree with example: obj = XGBoostClassifier(model, clip_values, preprocessing_defences, postprocessing_defences, preprocessing, nb_features, nb_classes)