Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/8126#discussion_r36908051
--- Diff:
mllib/src/test/java/org/apache/spark/mllib/clustering/JavaLDASuite.java ---
@@ -160,11 +160,42 @@ public void OnlineOptimizerCompatibility() {
assertEquals(roundedLocalTopicSummary.length, k);
}
+ @Test
+ public void logPerplexity(){
+ // Blindly copied from LDASuite.
+ JavaRDD<Tuple2<Long, Vector>> docs = sc.parallelize(toyData, 2);
+ assertEquals(toyModel.logPerplexity(JavaPairRDD.fromJavaRDD(docs)),
3.690, 1e-3);
--- End diff --
I would not test the value. Just make sure it runs in Java. Same for
other tests. Since it's difficult to test correctness for many ML algorithms,
I like isolating correctness tests to Scala.
That should also make the below tests shorter.
---
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]