imatiach-msft 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_r331839522
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala
 ##########
 @@ -106,13 +106,13 @@ private[spark] object GradientBoostedTrees extends 
Logging {
    *         corresponding to every sample.
    */
   def computeInitialPredictionAndError(
-      data: RDD[LabeledPoint],
+      data: RDD[Instance],
       initTreeWeight: Double,
       initTree: DecisionTreeRegressionModel,
       loss: OldLoss): RDD[(Double, Double)] = {
-    data.map { lp =>
-      val pred = updatePrediction(lp.features, 0.0, initTree, initTreeWeight)
-      val error = loss.computeError(pred, lp.label)
+    data.map { case Instance(label, _, features) =>
+      val pred = updatePrediction(features, 0.0, initTree, initTreeWeight)
+      val error = loss.computeError(pred, label)
 
 Review comment:
   hmm shouldn't the loss be weighted by the weight column value here?  seems a 
bit strange to ignore the weight column here

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to