Skip to content

Commit

Permalink
numRuns variable modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
FlytxtRnD committed Jul 3, 2015
1 parent 07f8554 commit d12336e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,11 @@ class KMeans private (

val initStartTime = System.nanoTime()

val numRuns = if (initialModel.nonEmpty) runs else 1
val numRuns = if (initialModel.isEmpty) 1 else runs

val centers = initialModel match {
case Some(kMeansCenters) => {
Array.tabulate(numRuns)(r => kMeansCenters.clusterCenters
.map(s => new VectorWithNorm(s, Vectors.norm(s, 2.0))))
Array(kMeansCenters.clusterCenters.map(s => new VectorWithNorm(s, Vectors.norm(s, 2.0))))
}
case None => {
if (initializationMode == KMeans.RANDOM) {
Expand Down

0 comments on commit d12336e

Please sign in to comment.