-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-22734][ML][PySpark] Added Python API for VectorSizeHint. #20112
Conversation
Test build #85496 has finished for PR 20112 at commit
|
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.
Thanks for the PR!
You'll need to add this class to the __all__
list at the top of the file.
Since VectorSizeHint modifies the inputCol, rather than creating a new outputCol, we should explicitly document this. Would you mind adding a note to the class doc string in both Python and Scala? (It's OK to do both in this PR.)
python/pyspark/ml/feature.py
Outdated
self._set(size=value) | ||
|
||
@keyword_only | ||
def __init__(self, inputCol=None, size=None, handleInvalid="error"): |
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.
Let's stick with the order which all other python classes follow: dummy Params, init, Param setters & getters
@@ -3466,6 +3466,72 @@ def selectedFeatures(self): | |||
return self._call_java("selectedFeatures") | |||
|
|||
|
|||
@inherit_doc | |||
class VectorSizeHint(JavaTransformer, HasInputCol, HasHandleInvalid, JavaMLReadable, |
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.
You'll need to override handleInvalid, like in the Scala API, since it takes different values & has a different docstring.
9a1ee2b
to
1ec7a41
Compare
Test build #85527 has finished for PR 20112 at commit
|
Test build #85528 has finished for PR 20112 at commit
|
Looks good except for the style issue |
Test build #85537 has finished for PR 20112 at commit
|
LGTM |
(Please fill in changes proposed in this fix)
Python API for VectorSizeHint Transformer.
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
doc-tests.