MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / build_feature_cols

Function build_feature_cols

modelzoo/features/runtime/deepfm/train.py:84–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83
84def build_feature_cols():
85 wide_column = []
86 deep_column = []
87 fm_column = []
88 for column_name in FEATURE_COLUMNS:
89 if column_name in CATEGORICAL_COLUMNS:
90 categorical_column = tf.feature_column.categorical_column_with_hash_bucket(
91 column_name,
92 # hash_bucket_size=HASH_BUCKET_SIZES[column_name],
93 hash_bucket_size=10000,
94 dtype=tf.string)
95
96 categorical_embedding_column = tf.feature_column.embedding_column(
97 categorical_column, dimension=16, combiner='mean')
98
99 wide_column.append(categorical_embedding_column)
100 deep_column.append(categorical_embedding_column)
101 fm_column.append(categorical_embedding_column)
102 else:
103 column = tf.feature_column.numeric_column(column_name, shape=(1, ))
104 wide_column.append(column)
105 deep_column.append(column)
106
107 return wide_column, fm_column, deep_column
108
109
110class DeepFM():

Callers 1

mainFunction · 0.70

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected