特征列
2019-09-21 14:34:45 0 举报
AI智能生成
机器学习,特征列
作者其他创作
大纲/内容
bucketized_column
bucketized_feature_column = tf.feature_column.bucketized_column(
source_column = numeric_feature_column,
boundaries = [1960, 1980, 2000]
source_column = numeric_feature_column,
boundaries = [1960, 1980, 2000]
Dense Column
numeric_column
默认数据类型 (tf.float32)
indicator_column
indicator_column = tf.feature_column.indicator_column(categorical_column)
子主题
embedding_column
embedding_column = tf.feature_column.embedding_column(
categorical_column=categorical_column,
dimension=dimension_of_embedding_vector)
categorical_column=categorical_column,
dimension=dimension_of_embedding_vector)
子主题
embedding_dimensions = number_of_categories**0.25
Categorical Column
categorical_column_with_identity
identity_feature_column = tf.feature_column.categorical_column_with_identity(
key='my_feature_b',
num_buckets=4)
key='my_feature_b',
num_buckets=4)
categorical_column_with_vocabulary_list
vocabulary_feature_column =
tf.feature_column.categorical_column_with_vocabulary_list(
key="a feature returned by input_fn()",
vocabulary_list=["kitchenware", "electronics", "sports"])
tf.feature_column.categorical_column_with_vocabulary_list(
key="a feature returned by input_fn()",
vocabulary_list=["kitchenware", "electronics", "sports"])
categorical_column_with_vocabulary_file
ocabulary_feature_column =
tf.feature_column.categorical_column_with_vocabulary_file(
key="a feature returned by input_fn()",
vocabulary_file="product_class.txt",
vocabulary_size=3)
tf.feature_column.categorical_column_with_vocabulary_file(
key="a feature returned by input_fn()",
vocabulary_file="product_class.txt",
vocabulary_size=3)
categorical_column_with_hash_bucket
hashed_feature_column =
tf.feature_column.categorical_column_with_hash_bucket(
key = "some_feature",
hash_buckets_size = 100) # The number of categories
tf.feature_column.categorical_column_with_hash_bucket(
key = "some_feature",
hash_buckets_size = 100) # The number of categories
crossed_column
crossed_lat_lon_fc = tf.feature_column.crossed_column(
[latitude_bucket_fc, longitude_bucket_fc], 5000)
[latitude_bucket_fc, longitude_bucket_fc], 5000)
收藏
收藏
0 条评论
下一页