-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-9654][ML][PYSPARK] Add IndexToString to PySpark #7976
[SPARK-9654][ML][PYSPARK] Add IndexToString to PySpark #7976
Conversation
Test build #39934 has finished for PR 7976 at commit
|
Test build #39947 has finished for PR 7976 at commit
|
Test build #39953 has finished for PR 7976 at commit
|
Test build #39970 has finished for PR 7976 at commit
|
Test build #39977 has finished for PR 7976 at commit
|
return StringIndexerInverse(self._java_obj.invert(inputCol, outputCol)) | ||
|
||
|
||
class StringIndexerInverse(JavaTransformer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also extend HasInputCol, HasOutputCol and have a "labels" Param.
Note: Since the underlying Scala code has changed this is not currently good to merge. I'm waiting until @jkbradley's change to make the labels visible goes in before updating this. |
…converting to regular string
ea655f3
to
e95b61b
Compare
And the required PR is now in master. |
Test build #40925 has finished for PR 7976 at commit
|
/** | ||
* The labels used for applying this transformation | ||
*/ | ||
private[spark] def getLabels() = labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer needed since "label" is a public val
@inherit_doc | ||
class IndexToString(JavaTransformer, HasInputCol, HasOutputCol): | ||
""" | ||
.. note:: Experimental |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: line break
LGTM, some really tiny nits |
@feynmanliang I'm not sure I agree with the changes to the param docs your asking for. |
Test build #41854 has finished for PR 7976 at commit
|
There's still a "." on L952. I agree my wording is not the clearest, do you have any thoughts about improving it? In any case, I think this issue is quite small and I'm fine leaving it as. I just thought it was weird to use "is supplied" on one line and "the empty array is ignored" in another as if they were two different things; is it reasonable to expect new users to assume that not passing in any params leads to |
Shouldn't L952 have a . on it? |
Test build #41860 has finished for PR 7976 at commit
|
Yes, sorry I was trying to point out that it currently doesn't have one and needs one added. I like the doc change! |
Test build #41887 has finished for PR 7976 at commit
|
Test build #41895 has finished for PR 7976 at commit
|
@@ -931,6 +937,63 @@ class StringIndexerModel(JavaModel): | |||
""" | |||
Model fitted by StringIndexer. | |||
""" | |||
@property | |||
def labels(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy Scala doc: "Ordered list of labels, corresponding to indices to be assigned"
That should be it. Thanks! |
Test build #42169 has finished for PR 7976 at commit
|
Merging with master. Thanks! |
Adds IndexToString to PySpark.