Double, features: org.apache.spark.mllib.linalg.Vector) val training = df. withColumn("x", df("x").cast("Double")). withColumn("tt", df("tt").cast("Double")). withColumn("status", df("status").cast("Double")). select("tt", "status", "x"). map(row => MyDF(row.getDouble(0), row.getDouble(1), Vectors.dense(row.getDouble(2)))). toDF("label", "censor", "features"). limit(100) 12/ 18