docstr: Train a model for a fixed number of epochs on a DataSet.
  
  # Arguments
  x: Input data. A Numpy array or RDD of Sample, ImageSet or TextSet or Spark DataFrame.
  y: Labels. A Numpy array. Default is None if x is already Sample RDD or ImageSet or TextSet.
  batch_size: Number of samples per gradient update. Default is 32.
  nb_epoch: Number of epochs to train.
  validation_data: Tuple (x_val, y_val) where x_val and y_val are both Numpy arrays.
                   Can also be RDD of Sample or ImageSet or TextSet.
                   Default is None if no validation is involved.
  distributed: Boolean. Whether to train the model in distributed mode or local mode.
               Default is True. In local mode, x and y must both be Numpy arrays.
  feature_cols: List of String, must be set if x is Spark DataFrame
  label_cols: List of String, must be set if x is Spark DataFrame
code: def fit(
      self,
      x,
      y=None,
      batch_size=32,
      nb_epoch=10,
      validation_split=0,
      validation_data=None,
      distributed=True,
      feature_cols=None,
      label_cols=None,
      transform=None,
  ):
      """
      Train a model for a fixed number of epochs on a DataSet.
  
      # Arguments
      x: Input data. A Numpy array or RDD of Sample, ImageSet or TextSet or Spark DataFrame.
      y: Labels. A Numpy array. Default is None if x is already Sample RDD or ImageSet or TextSet.
      batch_size: Number of samples per gradient update. Default is 32.
      nb_epoch: Number of epochs to train.
      validation_data: Tuple (x_val, y_val) where x_val and y_val are both Numpy arrays.
                       Can also be RDD of Sample or ImageSet or TextSet.
                       Default is None if no validation is involved.
      distributed: Boolean. Whether to train the model in distributed mode or local mode.
                   Default is True. In local mode, x and y must both be Numpy arrays.
      feature_cols: List of String, must be set if x is Spark DataFrame
      label_cols: List of String, must be set if x is Spark DataFrame
      """
  
      if distributed:
          if isinstance(x, np.ndarray) and isinstance(y, np.ndarray):
              if validation_data:
                  validation_data = to_sample_rdd(*validation_data)
              elif validation_split != 0:
                  if validation_split > 1 or validation_split < 0:
                      invalidInputError(
                          False, "validation split must in range [0, 1]"
                      )
                  split_index = int(len(x) * (1 - validation_split))
                  validation_data = (x[split_index:], y[split_index:])
                  x, y = x[:split_index], y[:split_index]
                  validation_data = to_sample_rdd(*validation_data)
              training_data = to_sample_rdd(x, y)
          elif (
              (
                  isinstance(x, RDD)
                  or isinstance(x, ImageSet)
                  or isinstance(x, TextSet)
              )
              or isinstance(x, FeatureSet)
              and not y
          ):
              training_data = x
          elif isinstance(x, DataFrame):
              if not label_cols:
                  invalidInputError(False, "Please set label_cols")
              if "image" not in x.columns:
                  if not feature_cols:
                      invalidInputError(
                          False, "Please set feature_cols"
                      )
                  callBigDlFunc(
                      self.bigdl_type,
                      "zooFit",
                      self.value,
                      x,
                      batch_size,
                      nb_epoch,
                      feature_cols,
                      label_cols,
                      validation_data,
                  )
                  return
              else:
                  callBigDlFunc(
                      self.bigdl_type,
                      "zooFitImage",
                      self.value,
                      x,
                      batch_size,
                      nb_epoch,
                      label_cols,
                      transform,
                      validation_data,
                  )
                  return
          else:
              y_error = (
                  ", y: %s. Excepted: x, y are ndarrays." % type(y)
                  if y
                  else ""
              )
              invalidInputError(
                  False,
                  "Unsupported training data type x: %s %s"
                  % (type(x), y_error),
              )
          callZooFunc(
              self.bigdl_type,
              "zooFit",
              self.value,
              training_data,
              batch_size,
              nb_epoch,
              validation_data,
          )
      else:
          if validation_data:
              val_x = [
                  JTensor.from_ndarray(x)
                  for x in to_list(validation_data[0])
              ]
              val_y = JTensor.from_ndarray(validation_data[1])
          else:
              val_x, val_y = None, None
          callZooFunc(
              self.bigdl_type,
              "zooFit",
              self.value,
              [JTensor.from_ndarray(x) for x in to_list(x)],
              JTensor.from_ndarray(y),
              batch_size,
              nb_epoch,
              val_x,
              val_y,
          )
  
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 14 for calling the KerasNet obj's underlying member method code with example usage: obj.fit(x, y, batch_size, nb_epoch, validation_split, validation_data, distributed, feature_cols, label_cols, transform) without return types