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

[Data] Add inverse transform functionality to LabelEncoder #37785

Merged
merged 16 commits into from
Oct 10, 2023

Conversation

samhallam-reverb
Copy link
Contributor

@samhallam-reverb samhallam-reverb commented Jul 25, 2023

Why are these changes needed?

This adds an inverse_transform method to the LabelEncoder class, inspired by similar functionality in scikit-learn.

Related issue number

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

Copy link
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Overall looks good. Just left some minor comments

python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Sep 16, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

  • If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@stale stale bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Sep 16, 2023
@stale stale bot removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Oct 3, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Attention: External code changed

A previous version of this PR changed code that is used or cited in external sources, e.g. blog posts.

It looks like these changes have been reverted or are otherwise not present in this PR anymore. Please still carefully review the changes to make sure code we use in external sources still works.

Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Copy link
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessor.py Outdated Show resolved Hide resolved
python/ray/data/preprocessors/encoder.py Outdated Show resolved Hide resolved
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
…nto inverse_transform

Signed-off-by: Sam Hallam <sam.hallam@reverb.com>
@bveeramani bveeramani merged commit 24012e5 into ray-project:master Oct 10, 2023
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants