Created
July 29, 2020 13:16
-
-
Save ntakouris/ecee79c942b6f74402499e8810c0befb 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
LABEL_KEY = 'lbl' | |
DENSE_FEATURES = ['a', 'b'] | |
BINARY_FEATURES = ['c'] | |
def preprocessing_fn(inputs: Dict[Text, Any]) -> Dict[Text, Any]: | |
outputs = {} | |
for feat in DENSE_FEATURES: | |
outputs[f'{feat}_xf'] = tft.scale_to_z_score(inputs[feat]) | |
for feat in BINARY_FEATURES: | |
outputs[feat] = inputs[feat] | |
outputs[LABEL_KEY] = inputs[LABEL_KEY] | |
return outputs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment