Skip to content

Commit 44050a9

Browse files
committed
Simpler constructor
1 parent c7050d5 commit 44050a9

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
@@ -178,7 +178,7 @@ class StreamingKMeans(
178178

179179
/** Specify initial centers directly. */
180180
def setInitialCenters(initialCenters: Array[Vector]): this.type = {
181-
val clusterCounts = Array.fill(this.k)(0).map(_.toLong)
181+
val clusterCounts = new Array[Long](this.k)
182182
this.model = new StreamingKMeansModel(initialCenters, clusterCounts)
183183
this
184184
}

0 commit comments

Comments
 (0)