You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xusen Yin (JIRA)" <ji...@apache.org> on 2016/01/12 18:26:40 UTC

[jira] [Updated] (SPARK-12780) Inconsistency returning value of ML python models' properties

     [ https://issues.apache.org/jira/browse/SPARK-12780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xusen Yin updated SPARK-12780:
------------------------------
    Description: 
In spark/python/pyspark/ml/feature.py, StringIndexerModel has a property method named labels, which is different with other properties in other models.

In StringIndexerModel:
{code}
@property
    @since("1.5.0")
    def labels(self):
        """
        Ordered list of labels, corresponding to indices to be assigned.
        """
        return self._java_obj.labels
{code}

In CounterVectorizerModel (as an example):
{code}
@property
    @since("1.6.0")
    def vocabulary(self):
        """
        An array of terms in the vocabulary.
        """
        return self._call_java("vocabulary")
{code}

In StringIndexerModel, the returned value of labels is not an array of labels as expected. Otherwise it is a JavaMember of py4j.

  was:
In spark/python/pyspark/ml/feature.py, StringIndexerModel has a property method named labels, which is different with other properties in other models.

In StringIndexerModel:
<code>
@property
    @since("1.5.0")
    def labels(self):
        """
        Ordered list of labels, corresponding to indices to be assigned.
        """
        return self._java_obj.labels
</code>

In CounterVectorizerModel (as an example):
<code>
@property
    @since("1.6.0")
    def vocabulary(self):
        """
        An array of terms in the vocabulary.
        """
        return self._call_java("vocabulary")
</code>

In StringIndexerModel, the returned value of labels is not an array of labels as expected. Otherwise it is a JavaMember of py4j.


> Inconsistency returning value of ML python models' properties
> -------------------------------------------------------------
>
>                 Key: SPARK-12780
>                 URL: https://issues.apache.org/jira/browse/SPARK-12780
>             Project: Spark
>          Issue Type: Bug
>          Components: ML, PySpark
>            Reporter: Xusen Yin
>            Priority: Minor
>
> In spark/python/pyspark/ml/feature.py, StringIndexerModel has a property method named labels, which is different with other properties in other models.
> In StringIndexerModel:
> {code}
> @property
>     @since("1.5.0")
>     def labels(self):
>         """
>         Ordered list of labels, corresponding to indices to be assigned.
>         """
>         return self._java_obj.labels
> {code}
> In CounterVectorizerModel (as an example):
> {code}
> @property
>     @since("1.6.0")
>     def vocabulary(self):
>         """
>         An array of terms in the vocabulary.
>         """
>         return self._call_java("vocabulary")
> {code}
> In StringIndexerModel, the returned value of labels is not an array of labels as expected. Otherwise it is a JavaMember of py4j.



--
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