docstr: A wrapper around one or two containers to do batch by batch prediction. The batch size is
  fixed when `base_container` is created. Together with `remainder_model_container`, this class
  enables prediction on a dataset of size `base_container._batch_size` * k +
  `remainder_model_container._batch_size`, where k is any integer. Its `predict` related method
  optionally takes `concatenate_outputs` argument, which when set to True causes the outputs to
  be returned as a list of individual prediction. This avoids an extra allocation of an output array
  and copying of each batch prediction into it.
  
  Args:
      base_container: One of subclasses of `SklearnContainer`.
      remainder_model_container: An auxiliary container that is used in the last iteration,
      if the test input batch size is not devisible by `base_container._batch_size`.
docstr_tok: ["A","wrapper","around","one","or","two","containers","to","do","batch","by","batch","prediction",".","The","batch","size","is","fixed","when","`","base_container","`","is","created",".","Together","with","`","remainder_model_container","`",",","this","class","enables","prediction","on","a","dataset","of","size","`","base_container._batch_size","`","*","k","+","`","remainder_model_container._batch_size","`",",","where","k","is","any","integer",".","Its","`","predict","`","related","method","optionally","takes","`","concatenate_outputs","`","argument",",","which","when","set","to","True","causes","the","outputs","to","be","returned","as","a","list","of","individual","prediction",".","This","avoids","an","extra","allocation","of","an","output","array","and","copying","of","each","batch","prediction","into","it",".","Args",":","base_container",":","One","of","subclasses","of","`","SklearnContainer","`",".","remainder_model_container",":","An","auxiliary","container","that","is","used","in","the","last","iteration",",","if","the","test","input","batch","size","is","not","devisible","by","`","base_container._batch_size","`","."]
code: def __init__(self, base_container, remainder_model_container=None):
      """
      A wrapper around one or two containers to do batch by batch prediction. The batch size is
      fixed when `base_container` is created. Together with `remainder_model_container`, this class
      enables prediction on a dataset of size `base_container._batch_size` * k +
      `remainder_model_container._batch_size`, where k is any integer. Its `predict` related method
      optionally takes `concatenate_outputs` argument, which when set to True causes the outputs to
      be returned as a list of individual prediction. This avoids an extra allocation of an output array
      and copying of each batch prediction into it.
  
      Args:
          base_container: One of subclasses of `SklearnContainer`.
          remainder_model_container: An auxiliary container that is used in the last iteration,
          if the test input batch size is not devisible by `base_container._batch_size`.
      """
      assert base_container._batch_size is not None
      self._base_container = base_container
      self._batch_size = base_container._batch_size
  
      if remainder_model_container:
          assert remainder_model_container._batch_size is not None
          self._remainder_model_container = remainder_model_container
          self._remainder_size = remainder_model_container._batch_size
      else:
          # This is remainder_size == 0 case
          # We repurpose base_container as a remainder_model_container
          self._remainder_model_container = base_container
          self._remainder_size = base_container._batch_size
  
file_path: hummingbird/hummingbird/ml/containers/batch_container.py
imports: import numpy
  from hummingbird.ml._utils import pandas_installed
label_desc: Use image node_id 1 to create a new BatchContainer object  with example: obj = BatchContainer(base_container, remainder_model_container)