We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5db7074 commit 9facbe3Copy full SHA for 9facbe3
mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala
@@ -165,7 +165,7 @@ class StreamingKMeans(
165
/** Initialize random centers, requiring only the number of dimensions. */
166
def setRandomCenters(d: Int): this.type = {
167
val initialCenters = (0 until k).map(_ => Vectors.dense(Array.fill(d)(nextGaussian()))).toArray
168
- val clusterCounts = Array.fill(0)(d).map(_.toLong)
+ val clusterCounts = Array.fill(this.k)(0).map(_.toLong)
169
this.model = new StreamingKMeansModel(initialCenters, clusterCounts)
170
this
171
}
0 commit comments