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

[AIR] Refactor _get_unique_value_indices #24144

Merged
merged 3 commits into from
Apr 28, 2022

Conversation

Yard1
Copy link
Member

@Yard1 Yard1 commented Apr 23, 2022

Why are these changes needed?

Refactors _get_unique_value_indices (used in Encoder preprocessors) for much improved performance with multiple columns. Also uses the same, more robust intermediary dataset format in _get_most_frequent_values (Imputers).

The existing unit tests pass, and no functionality has been changed.

Related issue number

Checks

  • 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 :(

@Yard1 Yard1 added this to the Ray AIR milestone Apr 23, 2022
@Yard1 Yard1 mentioned this pull request Apr 25, 2022
6 tasks
Copy link
Contributor

@clarkzinzow clarkzinzow left a comment

Choose a reason for hiding this comment

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

LGTM, just a small type annotation nit!

python/ray/ml/preprocessors/imputer.py Outdated Show resolved Hide resolved
Co-authored-by: Clark Zinzow <clarkzinzow@gmail.com>
dataset: Dataset, *columns: str
dataset: Dataset,
*columns: str,
drop_na_values: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add this if it's not being used?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's actually being used in the Categorizer PR! Left it in here by mistake, but if we are going to merge that as well, it doesn't really make a huge difference to keep it in.

@clarkzinzow clarkzinzow merged commit e62d3fa into ray-project:master Apr 28, 2022
clarkzinzow pushed a commit that referenced this pull request Apr 29, 2022
Adds a Categorizer preprocessor to automatically set the Categorical dtype on a dataset. This is useful for eg. LightGBM, which has build-in support for features with that dtype.

Depends on #24144.
@Yard1 Yard1 deleted the air_categoricals branch November 7, 2022 21:43
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.

None yet

3 participants