diff options
author | Bertrand Dechoux <BertrandDechoux@users.noreply.github.com> | 2015-08-07 16:07:24 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2015-08-07 16:07:24 -0700 |
commit | 902334fd55bbe40a57c1de2a9bdb25eddf1c8cf6 (patch) | |
tree | f9ee1a0be6b8bdb44289655f6bc561b75019d017 | |
parent | e2fbbe73111d4624390f596a19a1799c86a05f6c (diff) | |
download | spark-902334fd55bbe40a57c1de2a9bdb25eddf1c8cf6.tar.gz spark-902334fd55bbe40a57c1de2a9bdb25eddf1c8cf6.tar.bz2 spark-902334fd55bbe40a57c1de2a9bdb25eddf1c8cf6.zip |
[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
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala b/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala index 8ecb3df11d..96359024fa 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala @@ -120,11 +120,11 @@ object KMeansModel extends Loader[KMeansModel] { assert(className == thisClassName) assert(formatVersion == thisFormatVersion) val k = (metadata \ "k").extract[Int] - val centriods = sqlContext.read.parquet(Loader.dataPath(path)) - Loader.checkSchema[Cluster](centriods.schema) - val localCentriods = centriods.map(Cluster.apply).collect() - assert(k == localCentriods.size) - new KMeansModel(localCentriods.sortBy(_.id).map(_.point)) + val centroids = sqlContext.read.parquet(Loader.dataPath(path)) + Loader.checkSchema[Cluster](centroids.schema) + val localCentroids = centroids.map(Cluster.apply).collect() + assert(k == localCentroids.size) + new KMeansModel(localCentroids.sortBy(_.id).map(_.point)) } } } |