Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/9484#discussion_r44091629
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala ---
@@ -367,6 +367,34 @@ class LocalLDAModel private[clustering] (
}
/**
+ * Predicts the topic mixture distribution for a document (often called
"theta" in the
+ * literature). Returns a vector of zeros for an empty document.
+ *
+ * Note this means to allow quick query for single document. For batch
documents, please refer
+ * to [[topicDistributions(documents: RDD[(Long, Vector)])]] to avoid
overhead.
+ *
+ * @param document document to predict topic mixture distributions for
+ * @return (document ID, topic mixture distribution for document)
+ */
+ @Since("1.6.0")
+ def topicDistributions(document: (Long, Vector)): (Long, Vector) = {
--- End diff --
Can you please remove the doc ID? It's not necessary for a single doc, and
removing it will make this more Java-friendly.
---
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]