spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkbradley <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6684] [mllib] [ml] Add checkpointing to...
Date Thu, 30 Jul 2015 21:13:45 GMT
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7804#discussion_r35921506
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala
---
    @@ -246,21 +252,15 @@ object GradientBoostedTrees extends Logging {
     
             validatePredError = GradientBoostedTreesModel.updatePredictionError(
               validationInput, validatePredError, baseLearnerWeights(m), baseLearners(m),
loss)
    +        validatePredErrorCheckpointer.update(validatePredError)
             val currentValidateError = validatePredError.values.mean()
             if (bestValidateError - currentValidateError < validationTol) {
    -          return new GradientBoostedTreesModel(
    -            boostingStrategy.treeStrategy.algo,
    -            baseLearners.slice(0, bestM),
    -            baseLearnerWeights.slice(0, bestM))
    +          doneLearning = true
    --- End diff --
    
    I refactored this with "doneLearning" to avoid the use of "return" in the middle of the
loop.  That allows the cleanup of checkpoints to always happen.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message