docstr: Use a model to do prediction.
  
  # Arguments
  x: Prediction data. A Numpy array or RDD of Sample or ImageSet.
  batch_per_thread:
    The default value is 4.
    When distributed is True,the total batch size is batch_per_thread * rdd.getNumPartitions.
    When distributed is False the total batch size is batch_per_thread * numOfCores.
  distributed: Boolean. Whether to do prediction in distributed mode or local mode.
               Default is True. In local mode, x must be a Numpy array.
  feature_cols: List of String, must be set if x is Spark DataFrame
  prediction_col: String, must be set if x is Spark DataFrame
code: def predict(
      self,
      x,
      batch_per_thread=4,
      distributed=True,
      feature_cols=None,
      prediction_col=None,
      transform=None,
  ):
      """
      Use a model to do prediction.
  
      # Arguments
      x: Prediction data. A Numpy array or RDD of Sample or ImageSet.
      batch_per_thread:
        The default value is 4.
        When distributed is True,the total batch size is batch_per_thread * rdd.getNumPartitions.
        When distributed is False the total batch size is batch_per_thread * numOfCores.
      distributed: Boolean. Whether to do prediction in distributed mode or local mode.
                   Default is True. In local mode, x must be a Numpy array.
      feature_cols: List of String, must be set if x is Spark DataFrame
      prediction_col: String, must be set if x is Spark DataFrame
      """
      if isinstance(x, ImageSet) or isinstance(x, TextSet):
          results = callZooFunc(
              self.bigdl_type,
              "zooPredict",
              self.value,
              x,
              batch_per_thread,
          )
          return (
              ImageSet(results)
              if isinstance(x, ImageSet)
              else TextSet(results)
          )
      if isinstance(x, DataFrame):
          if not prediction_col:
              invalidInputError(False, "Please set prediction_col")
          if "image" not in x.columns:
              results = callZooFunc(
                  self.bigdl_type,
                  "zooPredict",
                  self.value,
                  x,
                  feature_cols,
                  prediction_col,
                  batch_per_thread,
              )
          else:
              results = callZooFunc(
                  self.bigdl_type,
                  "zooPredictImage",
                  self.value,
                  x,
                  prediction_col,
                  transform,
                  batch_per_thread,
              )
          return results
      if distributed:
          if isinstance(x, np.ndarray):
              invalidInputError(
                  len(x.shape) >= 2,
                  "x should be a batch of ndarray, "
                  + "dim should >= 2, but got %s" % str(x.shape),
              )
              # wrap x again, avoid an error if x is resized by np.asmatrix.
              x = np.resize(x, x.shape)
              data_rdd = to_sample_rdd(x, np.zeros([x.shape[0]]))
          elif isinstance(x, RDD):
              data_rdd = x
          else:
              invalidInputError(
                  False,
                  "Unsupported prediction data type: %s" % type(x),
              )
          results = callZooFunc(
              self.bigdl_type,
              "zooPredict",
              self.value,
              data_rdd,
              batch_per_thread,
          )
          return results.map(
              lambda result: Layer.convert_output(result)
          )
      else:
          if isinstance(x, np.ndarray) or isinstance(x, list):
              results = callZooFunc(
                  self.bigdl_type,
                  "zooPredict",
                  self.value,
                  self._to_jtensors(x),
                  batch_per_thread,
              )
              return [
                  Layer.convert_output(result) for result in results
              ]
          else:
              invalidInputError(
                  False,
                  "Unsupported prediction data type: %s" % type(x),
              )
  
imports: import bigdl.dllib.keras.autograd
  from bigdl.dllib.feature.image import ImageSet
  from bigdl.dllib.feature.text import TextSet
  from bigdl.dllib.feature.common import FeatureSet
  from bigdl.dllib.keras.base import ZooKerasLayer
  from bigdl.dllib.keras.utils import *
  from bigdl.dllib.nn.layer import Layer
  from bigdl.dllib.utils.file_utils import callZooFunc
label_desc: Use image node_id 18 for calling the KerasNet obj's underlying member method code with example usage: obj.predict(x, batch_per_thread, distributed, feature_cols, prediction_col, transform) and returns: unknown, results, results, unknown