class_docstr: Class for importing XGBoost models.
docstr: Perform prediction for a batch of inputs.
  
  :param x: Input samples.
  :return: Array of predictions of shape `(nb_inputs, nb_classes)`.
docstr_tok: ["Perform","prediction","for","a","batch","of","inputs",".",":","param","x",":","Input","samples",".",":","return",":","Array","of","predictions","of","shape","`","(","nb_inputs",",","nb_classes",")","`","."]
code: def predict(self, x: np.ndarray, **kwargs) -> np.ndarray:
      """
      Perform prediction for a batch of inputs.
  
      :param x: Input samples.
      :return: Array of predictions of shape `(nb_inputs, nb_classes)`.
      """
      import xgboost
  
      # Apply preprocessing
      x_preprocessed, _ = self._apply_preprocessing(
          x, y=None, fit=False
      )
  
      if isinstance(self._model, xgboost.Booster):
          train_data = xgboost.DMatrix(x_preprocessed, label=None)
          y_prediction = self._model.predict(train_data)
          if len(y_prediction.shape) == 1:
              y_prediction = to_categorical(
                  labels=y_prediction, nb_classes=self.nb_classes
              )
      elif isinstance(self._model, xgboost.XGBClassifier):
          y_prediction = self._model.predict_proba(x_preprocessed)
      else:
          raise ValueError("Type of model not recognized.")
  
      # Apply postprocessing
      y_prediction = self._apply_postprocessing(
          preds=y_prediction, fit=False
      )
  
      return y_prediction
  
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 5 for calling the XGBoostClassifier obj's underlying member method code with example usage: obj.predict(x) and returns: y_prediction