class_docstr: Class allowing to aggregate multiple classifiers as an ensemble. The individual classifiers are expected to be
  trained when the ensemble is created and no training procedures are provided through this class.
docstr: Perform prediction for a batch of inputs. Predictions from classifiers should only be aggregated if they all
  have the same type of output (e.g., probabilities). Otherwise, use `raw=True` to get predictions from all
  models without aggregation. The same option should be used for logits output, as logits are not comparable
  between models and should not be aggregated.
  
  :param x: Input samples.
  :param batch_size: Size of batches.
  :param raw: Return the individual classifier raw outputs (not aggregated).
  :return: Array of predictions of shape `(nb_inputs, nb_classes)`, or of shape
           `(nb_classifiers, nb_inputs, nb_classes)` if `raw=True`.
docstr_tok: ["Perform","prediction","for","a","batch","of","inputs",".","Predictions","from","classifiers","should","only","be","aggregated","if","they","all","have","the","same","type","of","output","(","e.g.",",","probabilities",")",".","Otherwise",",","use","`","raw=True","`","to","get","predictions","from","all","models","without","aggregation",".","The","same","option","should","be","used","for","logits","output",",","as","logits","are","not","comparable","between","models","and","should","not","be","aggregated",".",":","param","x",":","Input","samples",".",":","param","batch_size",":","Size","of","batches",".",":","param","raw",":","Return","the","individual","classifier","raw","outputs","(","not","aggregated",")",".",":","return",":","Array","of","predictions","of","shape","`","(","nb_inputs",",","nb_classes",")","`",",","or","of","shape","`","(","nb_classifiers",",","nb_inputs",",","nb_classes",")","`","if","`","raw=True","`","."]
code: def predict(  # pylint: disable=W0221
      self,
      x: np.ndarray,
      batch_size: int = 128,
      raw: bool = False,
      **kwargs,
  ) -> np.ndarray:
      """
      Perform prediction for a batch of inputs. Predictions from classifiers should only be aggregated if they all
      have the same type of output (e.g., probabilities). Otherwise, use `raw=True` to get predictions from all
      models without aggregation. The same option should be used for logits output, as logits are not comparable
      between models and should not be aggregated.
  
      :param x: Input samples.
      :param batch_size: Size of batches.
      :param raw: Return the individual classifier raw outputs (not aggregated).
      :return: Array of predictions of shape `(nb_inputs, nb_classes)`, or of shape
               `(nb_classifiers, nb_inputs, nb_classes)` if `raw=True`.
      """
      preds = np.array(
          [
              self.classifier_weights[i]
              * self.classifiers[i].predict(x)
              for i in range(self._nb_classifiers)
          ]
      )
      if raw:
          return preds
  
      # Aggregate predictions only at probabilities level, as logits are not comparable between models
      var_z = np.sum(preds, axis=0)
  
      # Apply postprocessing
      predictions = self._apply_postprocessing(preds=var_z, fit=False)
  
      return predictions
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import List, Optional, Union, Tuple, TYPE_CHECKING
  import numpy
  from art.estimators.classification.classifier import ClassifierNeuralNetwork
  from art.estimators.estimator import NeuralNetworkMixin
label_desc: Use image node_id 5 for calling the EnsembleClassifier obj's underlying member method code with example usage: obj.predict(x, batch_size, raw) and returns: predictions, preds