Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/4951#discussion_r26173145
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala ---
@@ -58,4 +66,59 @@ class KMeansModel (val clusterCenters: Array[Vector])
extends Serializable {
private def clusterCentersWithNorm: Iterable[VectorWithNorm] =
clusterCenters.map(new VectorWithNorm(_))
+
+ override def save(sc: SparkContext, path: String): Unit = {
+ KMeansModel.SaveLoadV1_0.save(sc, this, path)
+ }
+
+ override protected def formatVersion: String = "1.0"
+}
+
+object KMeansModel extends Loader[KMeansModel] {
+ override def load(sc: SparkContext, path: String): KMeansModel = {
+ KMeansModel.SaveLoadV1_0.load(sc, path)
+ }
+
+ case class IndexedPoint(id: Int, point: Vector)
--- End diff --
make this private. The class name could be changed to `case class
Cluster(id: Int, center: Vector)`. `IndexedPoint` is too general.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]