Github user yu-iskw commented on a diff in the pull request:
https://github.com/apache/spark/pull/6791#discussion_r32797065
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
@@ -465,6 +465,36 @@ private[python] class PythonMLLibAPI extends
Serializable {
}
/**
+ * Java stub for Python mllib LDA.run()
+ */
+ def trainLDAModel(
+ data: JavaRDD[LabeledPoint],
--- End diff --
Umm, it seems that we can't deal with `JavaRDD[(Long, Vector)]` in the
parameter of `trainLDAModel`. After all, I got the error message as follows,
when I run the test. Tuple of Python was recognized as `java.lang.Object` in
Java.
```
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
scala.Tuple2
at
org.apache.spark.mllib.api.python.PythonMLLibAPI$$anonfun$6.apply(PythonMLLibAPI.scala:489)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
...
```
According to `trainFPGrowthModel` and `trainWord2Vec`, dealing with input
data as array would be better. What do you think about this implementation?
https://github.com/yu-iskw/spark/commit/cdb2cf167097dda4f15eb690b7a73cadabdd3313
---
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]