Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/1425#discussion_r14988046
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetricsSuite.scala
---
@@ -20,8 +20,20 @@ package org.apache.spark.mllib.evaluation
import org.scalatest.FunSuite
import org.apache.spark.mllib.util.LocalSparkContext
+import org.apache.spark.mllib.util.TestingUtils._
class BinaryClassificationMetricsSuite extends FunSuite with
LocalSparkContext {
+
+ implicit class SeqDoubleWithAlmostEquals(val x: Seq[Double]) {
+ def almostEquals(y: Seq[Double], eps: Double = 1E-6): Boolean =
--- End diff --
1.0e-6 is way bigger than an ulp for a double; 1.0e-12 is more like it. I
understand a complex calculation might legitimately vary by significantly more
than an ulp depending on the implementation. As @mengxr says where you mean to
allow significantly more than machine precision worth of noise, that's probably
good to do with an explicitly larger epsilon. But this is certainly a good step
forward already.
---
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.
---