Github user yanboliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/14150#discussion_r70820419
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala ---
@@ -784,7 +784,13 @@ class DistributedLDAModel private[clustering] (
@Since("1.5.0")
def topTopicsPerDocument(k: Int): RDD[(Long, Array[Int], Array[Double])]
= {
graph.vertices.filter(LDA.isDocumentVertex).map { case (docID,
topicCounts) =>
- val topIndices = argtopk(topicCounts, k)
+ // TODO: Remove work-around for the breeze bug.
+ // https://github.com/scalanlp/breeze/issues/561
+ val topIndices = if (k == topicCounts.length) {
+ Seq.range(0, k)
+ } else {
+ argtopk(topicCounts, k)
+ }
--- End diff --
Here we hit the breeze bug (https://github.com/scalanlp/breeze/issues/561),
I use work-around here and sent PR to breeze to fix it.
---
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]