Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
freeman-lab committed Oct 25, 2014
1 parent 5db7074 commit 9facbe3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class StreamingKMeans(
/** Initialize random centers, requiring only the number of dimensions. */
def setRandomCenters(d: Int): this.type = {
val initialCenters = (0 until k).map(_ => Vectors.dense(Array.fill(d)(nextGaussian()))).toArray
val clusterCounts = Array.fill(0)(d).map(_.toLong)
val clusterCounts = Array.fill(this.k)(0).map(_.toLong)
this.model = new StreamingKMeansModel(initialCenters, clusterCounts)
this
}
Expand Down

0 comments on commit 9facbe3

Please sign in to comment.