Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/5330#discussion_r27700316
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala
---
@@ -143,17 +141,9 @@ class GradientBoostedTreesModel(
val broadcastWeights = sc.broadcast(treeWeights)
(1 until numIterations).map { nTree =>
- predictionAndError =
remappedData.zip(predictionAndError).mapPartitions { iter =>
- val currentTree = broadcastTrees.value(nTree)
- val currentTreeWeight = broadcastWeights.value(nTree)
- iter.map {
- case (point, (pred, error)) => {
- val newPred = pred + currentTree.predict(point.features) *
currentTreeWeight
- val newError = loss.computeError(newPred, point.label)
- (newPred, newError)
- }
- }
- }
+ predictionAndError = GradientBoostedTreesModel.updatePredictionError(
+ remappedData, predictionAndError, broadcastWeights.value(nTree),
--- End diff --
You should pass the broadcast variables themselves; don't extract the value
here since this happens before the mapPartitions().
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]