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

Add ApplyBucketsWithInterpolation TFTransform #31291

Merged
merged 5 commits into from
May 29, 2024

Conversation

jrmccluskey
Copy link
Contributor

Implements the apply_buckets_with_interpolation() Tensorflow Transform into MLTransform.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@jrmccluskey
Copy link
Contributor Author

assign set of reviewers

@jrmccluskey
Copy link
Contributor Author

jrmccluskey commented May 14, 2024

looks like the python 3.11 ML tests have some sort of setup issue (#31287)

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @shunping for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@tvalentyn
Copy link
Contributor

looks like the python 3.11 ML tests have some sort of setup issue (#31287)

for now you can consider this a new suite that never worked.

@tvalentyn
Copy link
Contributor

our ml tests are in a bad shape, but they were not running extensively previously.

Copy link
Contributor

Reminder, please take a look at this pr: @shunping

sdks/python/apache_beam/ml/transforms/tft.py Outdated Show resolved Hide resolved
[0, 1].

Input values are bucketized based on the provided boundaries such that the
input is mapped to a positive index i for which bucket_boundaries[i-1] <=
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 some escaping for code-snippets with backticks or something similar to make it look nicer in pydoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can try that out, added some backticks

input is mapped to a positive index i for which bucket_boundaries[i-1] <=
element < bucket_boundaries[i], if it exists. The values are then
normalized to the range [0,1] within the bucket, with NaN values being
mapped to 0.5.
Copy link
Contributor

Choose a reason for hiding this comment

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

should we link to TFT docs for more info as in some other ML Ops?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


Args:
columns: A list of column names to apply the transformation on.
bucket_boundaries: A rank 2 Tensor or list representing the bucket
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the typehint set correctly for bucket_boundaries? Is Rank 2 Tensor a 2d matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's consistent with what we're accepting as valid input in ApplyBuckets, both co-opt the language from TFT. Updating those to be more accurate to our function signature seems reasonable, changed for both functions

Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @tvalentyn for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@tvalentyn
Copy link
Contributor

waiting on author

Co-authored-by: tvalentyn <tvalentyn@users.noreply.github.com>
sdks/python/apache_beam/ml/transforms/tft.py Outdated Show resolved Hide resolved
Co-authored-by: tvalentyn <tvalentyn@users.noreply.github.com>
@jrmccluskey jrmccluskey merged commit 06e103d into apache:master May 29, 2024
89 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

2 participants