srowen commented on a change in pull request #21632: [SPARK-19591][ML][MLlib] Add sample weights to decision trees URL: https://github.com/apache/spark/pull/21632#discussion_r241777281
########## File path: mllib/src/main/scala/org/apache/spark/ml/feature/LabeledPoint.scala ########## @@ -37,4 +37,9 @@ case class LabeledPoint(@Since("2.0.0") label: Double, @Since("2.0.0") features: override def toString: String = { s"($label,$features)" } + + private[spark] def toInstance(weight: Double): Instance = { + Instance(label, weight, features) Review comment: I think this belongs in the Instance class, but, don't feel strongly about it. It can also specify a default value of 1.0 to avoid writing that in most calls. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org