class_docstr: Class for importing XGBoost models.
docstr: Return the number of output classes.
  
  :return: Number of classes in the data.
docstr_tok: ["Return","the","number","of","output","classes",".",":","return",":","Number","of","classes","in","the","data","."]
code: def _get_nb_classes(self, nb_classes: Optional[int]) -> Optional[int]:
      """
      Return the number of output classes.
  
      :return: Number of classes in the data.
      """
      from xgboost import Booster, XGBClassifier
  
      try:
          if isinstance(self._model, Booster):
              return int(len(self._model.get_dump(dump_format="json")) / self._model.n_estimators)  # type: ignore
          if isinstance(self._model, XGBClassifier):
              return self._model.n_classes_
      except AttributeError:
          # Attribute n_classes_ not found, will return default nb_classes value
          pass
  
      if nb_classes is not None:
          return nb_classes
      return None
  
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 7 for calling the XGBoostClassifier obj's underlying member method code with example usage: obj._get_nb_classes(nb_classes) and returns: None, nb_classes, int, self