There is a small snippet about loading sparse data but I have no idea how to use it.
SparseTensors don\'t play well with queues. If you use SparseTensors
You can use weighted_categorical_column
to parse index
and value
, eg.
categorical_column = tf.feature_column.categorical_column_with_identity(
key='index', num_buckets=your_feature_dim)
sparse_columns = tf.feature_column.weighted_categorical_column(
categorical_column=categorical_column, weight_feature_key='value')
then feed sparse_columns
to linear model estimator, before feed to DNN, please use embedding, eg.
dense_columns = tf.feature_column.embedding_column(sparse_columns, your_embedding_dim)
then feed dense_columns
to your DNN estimator