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

    https://github.com/apache/spark/pull/3702#discussion_r22183579
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetricsSuite.scala
 ---
    @@ -124,4 +124,36 @@ class BinaryClassificationMetricsSuite extends 
FunSuite with MLlibTestSparkConte
     
         validateMetrics(metrics, thresholds, rocCurve, prCurve, f1, f2, 
precisions, recalls)
       }
    +
    +  test("binary evaluation metrics with downsampling") {
    +    val scoreAndLabels = Seq(
    +      (0.1, 0.0), (0.2, 0.0), (0.3, 1.0), (0.4, 0.0), (0.5, 0.0),
    +      (0.6, 1.0), (0.7, 1.0), (0.8, 0.0), (0.9, 1.0))
    +
    +    val scoreAndLabelsRDD = sc.parallelize(scoreAndLabels, 1)
    +
    +    val original = new BinaryClassificationMetrics(scoreAndLabelsRDD)
    +    val originalROC = original.roc().collect().sorted.toList
    +    // Add 2 for (0,0) and (1,1) appended at either end
    +    assert(2 + scoreAndLabels.size == originalROC.size)
    +    assert(
    +      List(
    +        (0.0,0.0),(0.0,0.25),(0.2,0.25),(0.2,0.5),(0.2,0.75),(0.4,0.75),
    --- End diff --
    
    Scala style (spaces)  (not sure how strict this is when it's a list of 
values like this in a test)


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