Skip to content

Commit

Permalink
[SPARK-14440][PYSPARK] Remove pipeline specific reader and writer
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

https://issues.apache.org/jira/browse/SPARK-14440

Remove

* PipelineMLWriter
* PipelineMLReader
* PipelineModelMLWriter
* PipelineModelMLReader

and modify comments.

## How was this patch tested?

test with unit test.

Author: Xusen Yin <yinxusen@gmail.com>

Closes #12216 from yinxusen/SPARK-14440.
  • Loading branch information
yinxusen authored and mengxr committed Apr 18, 2016
1 parent 28ee157 commit f31a62d
Showing 1 changed file with 7 additions and 46 deletions.
53 changes: 7 additions & 46 deletions python/pyspark/ml/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@
from pyspark.mllib.common import inherit_doc


@inherit_doc
class PipelineMLWriter(JavaMLWriter):
"""
Private Pipeline utility class that can save ML instances through their Scala implementation.
We can currently use JavaMLWriter, rather than MLWriter, since Pipeline implements _to_java.
"""


@inherit_doc
class PipelineMLReader(JavaMLReader):
"""
Private utility class that can load Pipeline instances through their Scala implementation.
We can currently use JavaMLReader, rather than MLReader, since Pipeline implements _from_java.
"""


@inherit_doc
class Pipeline(Estimator, MLReadable, MLWritable):
"""
Expand Down Expand Up @@ -154,8 +136,8 @@ def copy(self, extra=None):

@since("2.0.0")
def write(self):
"""Returns an JavaMLWriter instance for this ML instance."""
return PipelineMLWriter(self)
"""Returns an MLWriter instance for this ML instance."""
return JavaMLWriter(self)

@since("2.0.0")
def save(self, path):
Expand All @@ -166,7 +148,7 @@ def save(self, path):
@since("2.0.0")
def read(cls):
"""Returns an MLReader instance for this class."""
return PipelineMLReader(cls)
return JavaMLReader(cls)

@classmethod
def _from_java(cls, java_stage):
Expand Down Expand Up @@ -201,27 +183,6 @@ def _to_java(self):
return _java_obj


@inherit_doc
class PipelineModelMLWriter(JavaMLWriter):
"""
Private PipelineModel utility class that can save ML instances through their Scala
implementation.
We can (currently) use JavaMLWriter, rather than MLWriter, since PipelineModel implements
_to_java.
"""


@inherit_doc
class PipelineModelMLReader(JavaMLReader):
"""
Private utility class that can load PipelineModel instances through their Scala implementation.
We can currently use JavaMLReader, rather than MLReader, since PipelineModel implements
_from_java.
"""


@inherit_doc
class PipelineModel(Model, MLReadable, MLWritable):
"""
Expand Down Expand Up @@ -254,8 +215,8 @@ def copy(self, extra=None):

@since("2.0.0")
def write(self):
"""Returns an JavaMLWriter instance for this ML instance."""
return PipelineModelMLWriter(self)
"""Returns an MLWriter instance for this ML instance."""
return JavaMLWriter(self)

@since("2.0.0")
def save(self, path):
Expand All @@ -265,8 +226,8 @@ def save(self, path):
@classmethod
@since("2.0.0")
def read(cls):
"""Returns an JavaMLReader instance for this class."""
return PipelineModelMLReader(cls)
"""Returns an MLReader instance for this class."""
return JavaMLReader(cls)

@classmethod
def _from_java(cls, java_stage):
Expand Down

0 comments on commit f31a62d

Please sign in to comment.