Skip to content
Snippets Groups Projects
Commit 902334fd authored by Bertrand Dechoux's avatar Bertrand Dechoux Committed by Joseph K. Bradley
Browse files

[SPARK-9748] [MLLIB] Centriod typo in KMeansModel

A minor typo (centriod -> centroid). Readable variable names help every users.

Author: Bertrand Dechoux <BertrandDechoux@users.noreply.github.com>

Closes #8037 from BertrandDechoux/kmeans-typo and squashes the following commits:

47632fe [Bertrand Dechoux] centriod typo
parent e2fbbe73
No related branches found
No related tags found
No related merge requests found
...@@ -120,11 +120,11 @@ object KMeansModel extends Loader[KMeansModel] { ...@@ -120,11 +120,11 @@ object KMeansModel extends Loader[KMeansModel] {
assert(className == thisClassName) assert(className == thisClassName)
assert(formatVersion == thisFormatVersion) assert(formatVersion == thisFormatVersion)
val k = (metadata \ "k").extract[Int] val k = (metadata \ "k").extract[Int]
val centriods = sqlContext.read.parquet(Loader.dataPath(path)) val centroids = sqlContext.read.parquet(Loader.dataPath(path))
Loader.checkSchema[Cluster](centriods.schema) Loader.checkSchema[Cluster](centroids.schema)
val localCentriods = centriods.map(Cluster.apply).collect() val localCentroids = centroids.map(Cluster.apply).collect()
assert(k == localCentriods.size) assert(k == localCentroids.size)
new KMeansModel(localCentriods.sortBy(_.id).map(_.point)) new KMeansModel(localCentroids.sortBy(_.id).map(_.point))
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment