code: def load_data_rdd(csv_file, shuffle=True, train=True):
      if shuffle:
          shuffle_csv(data_path + csv_file)
      data = sc.textFile(data_path + csv_file)
      data = data.filter(lambda x: x.split(",")[0] != "id").map(
          lambda line: line.split(",")
      )
      if train:
          data = data.map(
              lambda line: (
                  Vectors.dense(
                      np.asarray(line[1:-1]).astype(np.float32)
                  ),
                  str(line[-1]).replace("Class_", ""),
              )
          )
      else:
          data = data.map(
              lambda line: (
                  Vectors.dense(
                      np.asarray(line[1:]).astype(np.float32)
                  ),
                  "1",
              )
          )
      return data
  
file_path: elephas/examples/ml_pipeline_otto.py
imports: from pyspark.ml.linalg import Vectors
  import numpy
  import random
  from pyspark import SparkContext, SparkConf
  from pyspark.sql import SQLContext
  from pyspark.ml.feature import StringIndexer, StandardScaler
  from pyspark.ml import Pipeline
  from tensorflow.keras import optimizers
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.layers import Dense, Dropout, Activation
  from elephas.ml_model import ElephasEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: load_data_rdd(csv_file, shuffle, train) and returns: data