-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29565][ML][PYTHON] OneHotEncoder should support single-column input/output #26265
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
Conversation
|
Test build #112695 has finished for PR 26265 at commit
|
srowen
left a comment
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.
It seems OK for consistency. I guess however you can already specify just one input column? and is it more usual to one-hot encode probably all categoricals columns at once? I don't mind either way: making it consistent, or arguing this is a bit different and leaving it.
|
@srowen Thanks for your comment. I prefer to add the single column support for the consistency and completeness of the APIs. Also, in the use cases of one-hot encoding a single column, it's simpler and more convenient to use an API of one input column. |
mllib/src/main/scala/org/apache/spark/ml/feature/OneHotEncoder.scala
Outdated
Show resolved
Hide resolved
|
@huaxingao You need to rebase this PR. |
685b7e1 to
f3fa47d
Compare
|
Test build #112820 has finished for PR 26265 at commit
|
|
Test build #112821 has finished for PR 26265 at commit
|
|
Thanks! Merging to master. |
|
Thanks! @viirya @srowen @zhengruifeng |
What changes were proposed in this pull request?
add single-column input/ouput support in OneHotEncoder
Why are the changes needed?
Currently, OneHotEncoder only has multi columns support. It makes sense to support single column as well.
Does this PR introduce any user-facing change?
Yes
OneHotEncoder.setInputColOneHotEncoder.setOutputColHow was this patch tested?
Unit test