aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/ml/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark/ml/util.py')
-rw-r--r--python/pyspark/ml/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/pyspark/ml/util.py b/python/pyspark/ml/util.py
index 6703851262..d4411fdfb9 100644
--- a/python/pyspark/ml/util.py
+++ b/python/pyspark/ml/util.py
@@ -134,13 +134,14 @@ class MLWritable(object):
.. versionadded:: 2.0.0
"""
+ @property
def write(self):
"""Returns an JavaMLWriter instance for this ML instance."""
raise NotImplementedError("MLWritable is not yet implemented for type: %r" % type(self))
def save(self, path):
"""Save this ML instance to the given path, a shortcut of `write().save(path)`."""
- self.write().save(path)
+ self.write.save(path)
@inherit_doc
@@ -149,6 +150,7 @@ class JavaMLWritable(MLWritable):
(Private) Mixin for ML instances that provide :py:class:`JavaMLWriter`.
"""
+ @property
def write(self):
"""Returns an JavaMLWriter instance for this ML instance."""
return JavaMLWriter(self)