Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/12050#discussion_r58801668
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala
---
@@ -142,6 +158,97 @@ private[ml] object GradientBoostedTrees extends
Logging {
}
/**
+ * Add prediction from a new boosting iteration to an existing
prediction.
+ *
+ * @param features Vector of features representing a single data point.
+ * @param prediction The existing prediction.
+ * @param tree New Decision Tree model.
+ * @param weight Learning rate.
+ * @return Updated prediction.
+ */
+ def updatePrediction(
+ features: Vector,
+ prediction: Double,
+ tree: DecisionTreeRegressionModel,
+ weight: Double): Double = {
+ prediction + tree.rootNode.predictImpl(features).prediction * weight
--- End diff --
Right, you can leave it for now. I agree it should be made public. We can
discuss on [https://issues.apache.org/jira/browse/SPARK-10413]
---
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]