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 c446c58 commit ef95ee2Copy full SHA for ef95ee2
mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala
@@ -209,12 +209,13 @@ class KMeans private (
209
val initStartTime = System.nanoTime()
210
211
// Only one run is allowed when initialModel is given
212
- val numRuns = if (initialModel.nonEmpty){
213
- if (runs >1 ) logWarning("Ignoring runs; one run is allowed when initialModel is given.")
+ val numRuns = if (initialModel.nonEmpty) {
+ if (runs > 1) logWarning("Ignoring runs; one run is allowed when initialModel is given.")
214
1
215
- } else runs
216
-
217
+ } else {
+ runs
+ }
218
+
219
val centers = initialModel match {
220
case Some(kMeansCenters) => {
221
Array(kMeansCenters.clusterCenters.map(s => new VectorWithNorm(s)))
0 commit comments