You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/08 03:10:29 UTC

[GitHub] [spark] zhengruifeng commented on a change in pull request #25926: [SPARK-9612][ML] Add instance weight support for GBTs

zhengruifeng commented on a change in pull request #25926: [SPARK-9612][ML] Add instance weight support for GBTs
URL: https://github.com/apache/spark/pull/25926#discussion_r332320495
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala
 ##########
 @@ -68,7 +68,7 @@ class GradientBoostedTrees private[spark] (
   def run(input: RDD[LabeledPoint]): GradientBoostedTreesModel = {
     val algo = boostingStrategy.treeStrategy.algo
     val (trees, treeWeights) = NewGBT.run(input.map { point =>
-      NewLabeledPoint(point.label, point.features.asML)
+      NewLabeledPoint(point.label, point.features.asML).toInstance
 
 Review comment:
   Yes, it is better to directly create `Instance`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org