Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/3118#discussion_r20140161
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetricsSuite.scala
---
@@ -24,39 +24,99 @@ import org.apache.spark.mllib.util.TestingUtils._
class BinaryClassificationMetricsSuite extends FunSuite with
LocalSparkContext {
- def cond1(x: (Double, Double)): Boolean = x._1 ~= (x._2) absTol 1E-5
+ private def areWithinEpsilon(x: (Double, Double)): Boolean = x._1 ~=
(x._2) absTol 1E-5
- def cond2(x: ((Double, Double), (Double, Double))): Boolean =
+ private def pairsWithinEpsilon(x: ((Double, Double), (Double, Double))):
Boolean =
(x._1._1 ~= x._2._1 absTol 1E-5) && (x._1._2 ~= x._2._2 absTol 1E-5)
+ private def assertSequencesMatch(left: Seq[Double], right: Seq[Double]):
Unit = {
+ assert(left.zip(right).forall(areWithinEpsilon))
+ }
+
+ private def assertTupleSequencesMatch(left: Seq[(Double, Double)],
right: Seq[(Double, Double)]): Unit = {
+ assert(left.zip(right).forall(pairsWithinEpsilon))
+ }
+
+ private def validateMetrics(metrics: BinaryClassificationMetrics,
+ expectedThresholds: Seq[Double],
--- End diff --
Please use 4-space indentation. We don't use vertical alignment in Spark.
---
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]