Skip to content

Commit

Permalink
Modify the last brace and indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw committed Jul 1, 2015
1 parent 5bedc51 commit a4dfbef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,16 @@ class KMeans(override val uid: String) extends Estimator[KMeansModel] with KMean
def setSeed(value: Long): this.type = set(seed, value)

override def fit(dataset: DataFrame): KMeansModel = {
val map = this.extractParamMap()
val rdd = dataset.select(col(map(featuresCol))).map { case Row(point: Vector) => point}
val rdd = dataset.select(col($(featuresCol))).map { case Row(point: Vector) => point }

val algo = new MLlibKMeans()
.setK(map(k))
.setMaxIterations(map(maxIter))
.setSeed(map(seed))
.setK($(k))
.setInitializationMode($(initMode))
.setInitializationSteps($(initSteps))
.setMaxIterations($(maxIter))
.setSeed($(seed))
.setEpsilon($(epsilon))
.setRuns($(runs))
val parentModel = algo.run(rdd)
val model = new KMeansModel(uid, parentModel)
copyValues(model)
Expand Down

0 comments on commit a4dfbef

Please sign in to comment.