<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fit(self, rdd, epochs=10, batch_size=32, verbose=0, validation_split=0.1):
 """ Train an elephas model on an RDD. The Keras model configuration as specified in the elephas model is sent to Spark workers, abd each worker will be trained on their data partition. :param rdd: RDD with features and labels :param epochs: number of epochs used for training :param batch_size: batch size used for training :param verbose: logging verbosity level (0, 1 or 2) :param validation_split: percentage of data set aside for validation """

        print('>>> Fit model')
        if self.num_workers:
            rdd = rdd.repartition(self.num_workers)

        if self.mode in ['asynchronous', 'synchronous', 'hogwild']:
            self._fit(rdd, epochs, batch_size, verbose, validation_split)
        else:
            raise ValueError(
                "Choose from one of the modes: asynchronous, synchronous or hogwild")