Github user noel-smith commented on a diff in the pull request:
https://github.com/apache/spark/pull/8627#discussion_r39453363
--- Diff: python/pyspark/mllib/clustering.py ---
@@ -129,20 +135,32 @@ def computeCost(self, rdd):
[_convert_to_vector(c) for c in self.centers])
return cost
+ @since(1.4)
def save(self, sc, path):
+ """
+ Save this model to the given path.
+ """
java_centers = _py2java(sc, [_convert_to_vector(c) for c in
self.centers])
java_model =
sc._jvm.org.apache.spark.mllib.clustering.KMeansModel(java_centers)
java_model.save(sc._jsc.sc(), path)
@classmethod
+ @since('1.4.0')
def load(cls, sc, path):
+ """
+ Load a model from the given path.
+ """
java_model =
sc._jvm.org.apache.spark.mllib.clustering.KMeansModel.load(sc._jsc.sc(), path)
return KMeansModel(_java2py(sc, java_model.clusterCenters()))
class KMeans(object):
+ """
+ .. versionadded:: 0.9.1
--- End diff --
@davies Was `1.9.0-incubating` a public release? If so I'll update this to
from `1.9.1` to `1.9.0`
---
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]