Skip to content

Commit 9facbe3

Browse files
committed
Bug fix
1 parent 5db7074 commit 9facbe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class StreamingKMeans(
165165
/** Initialize random centers, requiring only the number of dimensions. */
166166
def setRandomCenters(d: Int): this.type = {
167167
val initialCenters = (0 until k).map(_ => Vectors.dense(Array.fill(d)(nextGaussian()))).toArray
168-
val clusterCounts = Array.fill(0)(d).map(_.toLong)
168+
val clusterCounts = Array.fill(this.k)(0).map(_.toLong)
169169
this.model = new StreamingKMeansModel(initialCenters, clusterCounts)
170170
this
171171
}

0 commit comments

Comments
 (0)