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

    https://github.com/apache/spark/pull/17556#discussion_r111434055
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala ---
    @@ -104,6 +104,18 @@ class RandomForestSuite extends SparkFunSuite with 
MLlibTestSparkContext {
           assert(splits.distinct.length === splits.length)
         }
     
    +    // SPARK-16957: Use weighted midpoints for split values.
    +    {
    +      val fakeMetadata = new DecisionTreeMetadata(1, 0, 0, 0,
    +        Map(), Set(),
    +        Array(2), Gini, QuantileStrategy.Sort,
    +        0, 0, 0.0, 0, 0
    +      )
    +      val featureSamples = Array(0, 1, 0, 0, 1, 0, 1, 1).map(_.toDouble)
    +      val splits = 
RandomForest.findSplitsForContinuousFeature(featureSamples, fakeMetadata, 0)
    +      assert(splits === Array(0.5))
    --- End diff --
    
    In this block, would you mind adding another test that exercises the 
`possibleSplits > numSplits` code path? It actually does get called below, but 
those tests are for other things and I think it's better to make it explicit 
what we are testing. 


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

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

Reply via email to