File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
mllib/src/main/scala/org/apache/spark/mllib/clustering Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -210,14 +210,15 @@ class LDA private (
210210
211211 /**
212212 * Set the LDAOptimizer used to perform the actual calculation by algorithm name.
213- * Currently "em" is supported.
213+ * Currently "em", "online" is supported.
214214 */
215215 def setOptimizer (optimizerName : String ): this .type = {
216216 this .ldaOptimizer =
217217 optimizerName.toLowerCase match {
218218 case " em" => new EMLDAOptimizer
219+ case " online" => new OnlineLDAOptimizer
219220 case other =>
220- throw new IllegalArgumentException (s " Only em is supported but got $other. " )
221+ throw new IllegalArgumentException (s " Only em, online are supported but got $other. " )
221222 }
222223 this
223224 }
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ class OnlineLDAOptimizer extends LDAOptimizer {
396396 val batchResult = statsSum :* expElogbeta
397397
398398 // Note that this is an optimization to avoid batch.count
399- update(batchResult, iteration, (miniBatchFraction * corpusSize).toInt)
399+ update(batchResult, iteration, (miniBatchFraction * corpusSize).ceil. toInt)
400400 this
401401 }
402402
You can’t perform that action at this time.
0 commit comments