Skip to content

Commit b89243b

Browse files
BertrandDechouxCodingCat
authored andcommitted
[SPARK-9748] [MLLIB] Centriod typo in KMeansModel
A minor typo (centriod -> centroid). Readable variable names help every users. Author: Bertrand Dechoux <[email protected]> Closes apache#8037 from BertrandDechoux/kmeans-typo and squashes the following commits: 47632fe [Bertrand Dechoux] centriod typo
1 parent e75f710 commit b89243b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ object KMeansModel extends Loader[KMeansModel] {
120120
assert(className == thisClassName)
121121
assert(formatVersion == thisFormatVersion)
122122
val k = (metadata \ "k").extract[Int]
123-
val centriods = sqlContext.read.parquet(Loader.dataPath(path))
124-
Loader.checkSchema[Cluster](centriods.schema)
125-
val localCentriods = centriods.map(Cluster.apply).collect()
126-
assert(k == localCentriods.size)
127-
new KMeansModel(localCentriods.sortBy(_.id).map(_.point))
123+
val centroids = sqlContext.read.parquet(Loader.dataPath(path))
124+
Loader.checkSchema[Cluster](centroids.schema)
125+
val localCentroids = centroids.map(Cluster.apply).collect()
126+
assert(k == localCentroids.size)
127+
new KMeansModel(localCentroids.sortBy(_.id).map(_.point))
128128
}
129129
}
130130
}

0 commit comments

Comments
 (0)