Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/1628#discussion_r15611248
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
@@ -453,4 +454,75 @@ class PythonMLLibAPI extends Serializable {
val ratings = ratingsBytesJRDD.rdd.map(unpackRating)
ALS.trainImplicit(ratings, rank, iterations, lambda, blocks, alpha)
}
+
+ /**
+ * Java stub for Python mllib RandomRDDGenerators.uniformRDD()
+ */
+ def uniformRDD(jsc: JavaSparkContext,
+ size: Long,
+ numPartitions: Int,
+ seed: Long): JavaRDD[Array[Byte]] = {
+ RandomRDDGenerators.uniformRDD(jsc.sc, size, numPartitions, seed)
+ .map(serializeDouble).toJavaRDD()
+ }
+
+ /**
+ * Java stub for Python mllib RandomRDDGenerators.normalRDD()
+ */
+ def normalRDD(jsc: JavaSparkContext,
+ size: Long,
+ numPartitions: Int,
+ seed: Long): JavaRDD[Array[Byte]] = {
+ RandomRDDGenerators.normalRDD(jsc.sc, size, numPartitions, seed)
+ .map(serializeDouble).toJavaRDD()
--- End diff --
You could actually leave out the `toJavaRDD()`s here and use the implicits
defined in `JavaRDD`; we do this in a lot of the other Java APIs, including
JavaRDD:
https://github.com/dorx/spark/blob/pythonRDD/core/src/main/scala/org/apache/spark/api/java/JavaRDD.scala#L88
---
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.
---