Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/8643#discussion_r43720929
--- Diff: python/pyspark/mllib/clustering.py ---
@@ -690,6 +690,21 @@ class LDAModel(JavaModelWrapper):
>>> model = LDA.train(rdd, k=2)
>>> model.vocabSize()
2
+ >>> topics = model.describeTopics()
+ >>> len(topics)
+ 2
+ >>> len(list(topics[0])[0])
+ 2
+ >>> len(list(topics[0])[1])
+ 2
+ >>> topics = model.describeTopics(1)
--- End diff --
One test case should be enough.
These test will become example in docs, so it's better to be more readable,
for example:
```
>>> list(sorted(model.describeTopics()))
[([0, 1], [0.50..., 0.49...]), ([1, 0], [0.50..., 0.49...])]
```
---
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]