Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/7705#discussion_r35726247
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala ---
@@ -463,15 +458,73 @@ final class OnlineLDAOptimizer extends LDAOptimizer {
new BDM[Double](col, row, temp).t
}
+
+ override private[clustering] def getLDAModel(iterationTimes:
Array[Double]): LDAModel = {
+ new LocalLDAModel(Matrices.fromBreeze(lambda).transpose, alpha, eta,
gammaShape)
+ }
+
+}
+
+/**
+ * Serializable companion object containing helper methods and shared code
for
+ * [[OnlineLDAOptimizer]] and [[LocalLDAModel]].
+ */
+object OnlineLDAOptimizer {
/**
- * For theta ~ Dir(alpha), computes E[log(theta)] given alpha. Currently
the implementation
- * uses digamma which is accurate but expensive.
+ * Uses variational inference to infer the topic distribution `gammad`
given the term counts
+ * for a document.
+ *
+ * An optimization (Lee, Seung: Algorithms for non-negative matrix
factorization, NIPS 2001)
+ * avoids explicit computation of variational parameter `phi`.
+ * @see http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.7566
--- End diff --
Put double brackets around link to make it a link in Scala doc.
---
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]