[SPARK-11506][MLLIB] Removed redundant operation in Online LDA implementation
In file LDAOptimizer.scala: line 441: since "idx" was never used, replaced unrequired zipWithIndex.foreach with foreach. - nonEmptyDocs.zipWithIndex.foreach { case ((_, termCounts: Vector), idx: Int) => + nonEmptyDocs.foreach { case (_, termCounts: Vector) => Author: a1singh <a1singh@ucsd.edu> Closes #9456 from a1singh/master.
This commit is contained in:
parent
7bdc92197c
commit
a94671a027
|
@ -438,7 +438,7 @@ final class OnlineLDAOptimizer extends LDAOptimizer {
|
||||||
|
|
||||||
val stat = BDM.zeros[Double](k, vocabSize)
|
val stat = BDM.zeros[Double](k, vocabSize)
|
||||||
var gammaPart = List[BDV[Double]]()
|
var gammaPart = List[BDV[Double]]()
|
||||||
nonEmptyDocs.zipWithIndex.foreach { case ((_, termCounts: Vector), idx: Int) =>
|
nonEmptyDocs.foreach { case (_, termCounts: Vector) =>
|
||||||
val ids: List[Int] = termCounts match {
|
val ids: List[Int] = termCounts match {
|
||||||
case v: DenseVector => (0 until v.size).toList
|
case v: DenseVector => (0 until v.size).toList
|
||||||
case v: SparseVector => v.indices.toList
|
case v: SparseVector => v.indices.toList
|
||||||
|
|
Loading…
Reference in a new issue