Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14216#discussion_r71537572
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizerSuite.scala
---
@@ -245,4 +245,27 @@ class MultivariateOnlineSummarizerSuite extends
SparkFunSuite {
absTol 1E-8, "normL2 mismatch")
assert(summarizer.normL1 ~== Vectors.dense(0.21, 0.4265, 0.61) absTol
1E-10, "normL1 mismatch")
}
+
+ test("test min/max with weighted samples (SPARK-16561)") {
+ val summarizer1 = (new MultivariateOnlineSummarizer)
+ .add(Vectors.dense(10.0, -10.0), 1e10)
+ .add(Vectors.dense(0.0, 0.0), 1e-10)
+
+ val summarizer2 = new MultivariateOnlineSummarizer
+ summarizer2.add(Vectors.dense(10.0, -10.0), 1e10)
+ for (i <- 1 to 100)
--- End diff --
I think this will fail the style checker without braces. If so and while
you're here, this is a nit, but can you write `new
MultivariateOnlineSummarizer()` because it has side effects? Also I personally
prefer 1.0e-7 for example to make it clear it's a double.
---
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]