Github user aloknsingh commented on a diff in the pull request:
https://github.com/apache/spark/pull/7064#discussion_r33736971
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala ---
@@ -99,9 +99,15 @@ class LDASuite extends SparkFunSuite with
MLlibTestSparkContext {
// Check: per-doc topic distributions
val topicDistributions = model.topicDistributions.collect()
+
// Ensure all documents are covered.
- assert(topicDistributions.length === tinyCorpus.length)
- assert(tinyCorpus.map(_._1).toSet ===
topicDistributions.map(_._1).toSet)
+ // SPARK-5562. since the topicDistribution returns the distribution of
docsI over topics .
+ // for empty docs, since the distribution of topic won't sum to 1 (and
hence it is not a pdf)
+ // So the output will not contain the empty docs and hence we modify
the unittest to
+ // compare against nonEmptyTinyCorpus
+ val nonEmptyTinyCorpus = getNonEmptyDoc(tinyCorpus)
+ assert(topicDistributions.length === nonEmptyTinyCorpus.length)
--- End diff --
As you had pointed out later. going with the options 1 and updating the
docs at mllib-clustering.md would be better and I agree with you. I will pull
the the changes in.
---
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]