我想弄清楚如何使用
age = tf.contrib.layers.real_valued_column("age")
age_buckets = tf.contrib.layers.bucketized_column(age, boundaries=[18, 25, 30, 35, 40, 45, 50, 55, 60, 65])
答案 0 :(得分:1)
从该文件复制:
age_column = real_valued_column("age")
bucketized_age_column = bucketized_column(
source_column=age_column,
boundaries=[18, 25, 30, 35, 40, 45, 50, 55, 60, 65])
first_layer = input_from_feature_columns(...,
feature_columns=[..., bucketized_age_column])
second_layer = fully_connected(first_layer, ...)
# For linear models
predicitions, _, _ = weighted_sum_from_feature_columns(...,
feature_columns=[..., bucketized_age_column])