Created
July 15, 2018 11:09
-
-
Save securetorobert/e47b0f0bdcd96bffbdc515c18dbf9b20 to your computer and use it in GitHub Desktop.
Create a bucketized column from a numeric column
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
# A numeric column for the raw input. | |
numeric_feature_column = tf.feature_column.numeric_column("Year") | |
# Bucketize the numeric column on the years 1960, 1980, and 2000 | |
bucketized_feature_column = tf.feature_column.bucketized_column( | |
source_column = numeric_feature_column, | |
boundaries = [1960, 1980, 2000]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment