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_r331839713
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala
##########
@@ -129,20 +129,17 @@ private[spark] object GradientBoostedTrees extends
Logging {
* corresponding to each sample.
*/
def updatePredictionError(
- data: RDD[LabeledPoint],
+ data: RDD[Instance],
predictionAndError: RDD[(Double, Double)],
treeWeight: Double,
tree: DecisionTreeRegressionModel,
loss: OldLoss): RDD[(Double, Double)] = {
-
- val newPredError = data.zip(predictionAndError).mapPartitions { iter =>
- iter.map { case (lp, (pred, error)) =>
- val newPred = updatePrediction(lp.features, pred, tree, treeWeight)
- val newError = loss.computeError(newPred, lp.label)
+ data.zip(predictionAndError).map {
+ case (Instance(label, _, features), (pred, _)) =>
Review comment:
same thing here - it seems like we are ignoring the weight column but
intuitively it seems like it should be included, could you explain the
reasoning behind it being excluded 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]