Github user akopich commented on a diff in the pull request: https://github.com/apache/spark/pull/19565#discussion_r147229232 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala --- @@ -446,14 +445,14 @@ final class OnlineLDAOptimizer extends LDAOptimizer with Logging { override private[clustering] def next(): OnlineLDAOptimizer = { val batch = docs.sample(withReplacement = sampleWithReplacement, miniBatchFraction, randomGenerator.nextLong()) - if (batch.isEmpty()) return this --- End diff -- So technically, you suggest to move the check ``` if (batchSize == 0) { logWarning("No non-empty documents were submitted in the batch.") // Therefore, there is no need to update any of the model parameters return this } ``` to `next()`? Sounds reasonable.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org