Skip to content
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

[Datasets] Allow MultiHotEncoder to encode arrays #31365

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

bveeramani
Copy link
Member

Signed-off-by: Balaji Veeramani [email protected]

Why are these changes needed?

tl;dr: MultiHotEncoder doesn't work with Arrow datasets. This PR updates the MultiHotEncoder implementation to fix the issue.

MultiHotEncoder implements the _transform_pandas method. So, when MultiHotEncoder transforms a dataset, it converts Arrow blocks to pandas DataFrames. During the conversion, lists are converted to ndarrays. This causes MultiHotEncoder to error, because MultiHotEncoder doesn't support ndarrays (only built-in lists).

Related issue number

Fixes #31353

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Balaji Veeramani <[email protected]>
@amogkam amogkam merged commit a34fa71 into ray-project:master Jan 4, 2023
AmeerHajAli pushed a commit that referenced this pull request Jan 12, 2023
MultiHotEncoder doesn't work with Arrow datasets. This PR updates the MultiHotEncoder implementation to fix the issue.

Signed-off-by: Balaji Veeramani <[email protected]>
tamohannes pushed a commit to ju2ez/ray that referenced this pull request Jan 25, 2023
MultiHotEncoder doesn't work with Arrow datasets. This PR updates the MultiHotEncoder implementation to fix the issue.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: tmynn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Datasets] MultiHotEncoder doesn't work with Arrow datasets
6 participants