Github user zhengruifeng commented on a diff in the pull request: https://github.com/apache/spark/pull/15414#discussion_r82718401 --- Diff: mllib/src/main/scala/org/apache/spark/ml/Predictor.scala --- @@ -121,10 +122,18 @@ abstract class Predictor[ * and put it in an RDD with strong types. */ protected def extractLabeledPoints(dataset: Dataset[_]): RDD[LabeledPoint] = { - dataset.select(col($(labelCol)).cast(DoubleType), col($(featuresCol))).rdd.map { + dataset.select(col($(labelCol)), col($(featuresCol))).rdd.map { case Row(label: Double, features: Vector) => LabeledPoint(label, features) } } + + /** + * Return the given DataFrame, with [[labelCol]] casted to DoubleType. + */ + protected def castDataSet(dataset: Dataset[_]): DataFrame = { + val labelMeta = dataset.schema.fields.filter(_.name == $(labelCol)).head.metadata --- End diff -- Thanks
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org