Created
July 8, 2020 12:56
-
-
Save ntakouris/33da3a79fd899a73b101f3cafb3817ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocessing_fn(inputs): | |
"""Preprocess input columns into transformed columns.""" | |
x = inputs['x'] | |
y = inputs['y'] | |
s = inputs['s'] | |
x_centered = x - tft.mean(x) | |
y_normalized = tft.scale_to_0_1(y) | |
s_integerized = tft.compute_and_apply_vocabulary(s) | |
x_centered_times_y_normalized = (x_centered * y_normalized) | |
return { | |
'x_centered': x_centered, | |
'y_normalized': y_normalized, | |
's_integerized': s_integerized, | |
'x_centered_times_y_normalized': x_centered_times_y_normalized, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment