Github user WeichenXu123 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19565#discussion_r146799989
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala ---
@@ -497,40 +495,38 @@ final class OnlineLDAOptimizer extends LDAOptimizer
with Logging {
(u._1, u._2, u._3 + v._3)
}
- val (statsSum: BDM[Double], logphatOption: Option[BDV[Double]],
nonEmptyDocsN: Long) = stats
+ val (statsSum: BDM[Double], logphatOption: Option[BDV[Double]],
batchSize: Long) = stats
.treeAggregate((BDM.zeros[Double](k, vocabSize),
logphatPartOptionBase(), 0L))(
elementWiseSum, elementWiseSum
)
--- End diff --
Not a big deal, but I think here use `mapPartition`(do aggregate in it) and
then do treeAggregate, the process can be merged into one `treeAggregate`, is
it right? it make the code more clear.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]