You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Miao Wang (JIRA)" <ji...@apache.org> on 2016/04/01 23:58:25 UTC

[jira] [Commented] (SPARK-14249) Change MLReader.read to be a property for PySpark

    [ https://issues.apache.org/jira/browse/SPARK-14249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15222402#comment-15222402 ] 

Miao Wang commented on SPARK-14249:
-----------------------------------

[~josephkb]: I did a research and tested adding the classproperty class. The load method in MLReadable() is also a class method. Even I created the classproperty class and made the change below:

 @classmethod
 @classproperty
    def read(cls):
        """Returns an JavaMLReader instance for this class."""
        raise NotImplementedError("MLReadable.read() not implemented for type: %r" % cls)

@classmethod
    def load(cls, path):
        """Reads an ML instance from the input path, a shortcut of `read().load(path)`."""
        return cls.read.load(path)

read is not callable because load is a classmethod.

Shall we make further changes or leave it as it is now? I think it might not be worth making changes now.

Thanks!

Miao

> Change MLReader.read to be a property for PySpark
> -------------------------------------------------
>
>                 Key: SPARK-14249
>                 URL: https://issues.apache.org/jira/browse/SPARK-14249
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML, PySpark
>            Reporter: Joseph K. Bradley
>            Priority: Minor
>
> To match MLWritable.write and SQLContext.read, it will be good to make the PySpark MLReader classmethod {{read}} be a property.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org