Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4677#discussion_r25140487
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
 ---
    @@ -158,6 +158,63 @@ class GradientBoostedTreesSuite extends FunSuite with 
MLlibTestSparkContext {
           }
         }
       }
    +
    +  test("runWithValidation performs better on a validation dataset 
(Regression)") {
    +    // Set numIterations large enough so that it early stops.
    +    val numIterations = 20
    +    val trainRdd = sc.parallelize(GradientBoostedTreesSuite.trainData, 2)
    +    val validateRdd = 
sc.parallelize(GradientBoostedTreesSuite.validateData, 2)
    +
    +    val treeStrategy = new Strategy(algo = Regression, impurity = 
Variance, maxDepth = 2,
    +      categoricalFeaturesInfo = Map.empty)
    +    Array(SquaredError, AbsoluteError).foreach { error =>
    +      val boostingStrategy =
    +        new BoostingStrategy(treeStrategy, error, numIterations, 
validationTol = 0.0)
    +
    +      val gbtValidate = new 
GradientBoostedTrees(boostingStrategy).runWithValidation(
    --- End diff --
    
    formatting: Put .runWithValidation on the next line with its parameters


---
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]

Reply via email to