Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/6994#discussion_r34226866
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
---
@@ -158,4 +158,47 @@ object Statistics {
def chiSqTest(data: RDD[LabeledPoint]): Array[ChiSqTestResult] = {
ChiSqTest.chiSquaredFeatures(data)
}
+
+ /**
+ * Conduct the two-sided Kolmogorov Smirnov test for data sampled from a
+ * continuous distribution. By comparing the largest difference between
the empirical cumulative
+ * distribution of the sample data and the theoretical distribution we
can provide a test for the
+ * the null hypothesis that the sample data comes from that theoretical
distribution.
+ * For more information on KS Test:
+ * @see [[https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test]]
+ *
+ * Implementation note: We seek to implement the KS test with a minimal
number of distributed
+ * passes. We sort the RDD, and then perform the following operations on
a per-partition basis:
+ * calculate an empirical cumulative distribution value for each
observation, and a theoretical
+ * cumulative distribution value. We know the latter to be correct,
while the former will be off
+ * by a constant (how large the constant is depends on how many values
precede it in other
+ * partitions).However, given that this constant simply shifts the ECDF
upwards, but doesn't
--- End diff --
`.However` -> `. However`
`ECDF` is not defined. This is not a standard term in statistics.
`empirical CDF` is fine.
---
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]