Github user BimalTandel commented on a diff in the pull request:
https://github.com/apache/spark/pull/7730#discussion_r35697701
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
---
@@ -81,10 +85,14 @@ object Statistics {
* @param x RDD[Double] of the same cardinality as y.
* @param y RDD[Double] of the same cardinality as x.
* @return A Double containing the Pearson correlation between the two
input RDD[Double]s
+ * @since 1.1.0
*/
def corr(x: RDD[Double], y: RDD[Double]): Double = Correlations.corr(x,
y)
- /** Java-friendly version of [[corr()]] */
+ /**
+ * Java-friendly version of [[corr()]]
+ * @since 1.4.1
+ */
--- End diff --
There seems to be a disconnect between the API doc and the code. The Java
friendly methods were added in 1.4.1
diff --git
a/v1.4.0:mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
b/v1.4.1:mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
index b3fad0c..900007e 100644
---
a/v1.4.0:mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
+++
b/v1.4.1:mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala
@@ -18,6 +18,7 @@
package org.apache.spark.mllib.stat
import org.apache.spark.annotation.Experimental
+import org.apache.spark.api.java.JavaRDD
import org.apache.spark.mllib.linalg.distributed.RowMatrix
import org.apache.spark.mllib.linalg.{Matrix, Vector}
import org.apache.spark.mllib.regression.LabeledPoint
@@ -80,6 +81,10 @@ object Statistics {
*/
def corr(x: RDD[Double], y: RDD[Double]): Double = Correlations.corr(x,
y)
+ /** Java-friendly version of [[corr()]] */
+ def corr(x: JavaRDD[java.lang.Double], y: JavaRDD[java.lang.Double]):
Double =
+ corr(x.rdd.asInstanceOf[RDD[Double]], y.rdd.asInstanceOf[RDD[Double]])
+
/**
* Compute the correlation for the input RDDs using the specified method.
* Methods currently supported: `pearson` (default), `spearman`.
@@ -96,6 +101,10 @@ object Statistics {
*/
def corr(x: RDD[Double], y: RDD[Double], method: String): Double =
Correlations.corr(x, y, method)
+ /** Java-friendly version of [[corr()]] */
+ def corr(x: JavaRDD[java.lang.Double], y: JavaRDD[java.lang.Double],
method: String): Double =
+ corr(x.rdd.asInstanceOf[RDD[Double]], y.rdd.asInstanceOf[RDD[Double]],
method)
+
/**
* Conduct Pearson's chi-squared goodness of fit test of the observed
data against the
* expected distribution.
---
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]