W3cubDocs

/TensorFlow Python

tf.contrib.layers.sparse_column_with_integerized_feature(column_name, bucket_size, combiner=None, dtype=tf.int64)

tf.contrib.layers.sparse_column_with_integerized_feature(column_name, bucket_size, combiner=None, dtype=tf.int64)

See the guide: Layers (contrib) > Feature columns

Creates an integerized _SparseColumn.

Use this when your features are already pre-integerized into int64 IDs. output_id = input_feature

Args:

  • column_name: A string defining sparse column name.
  • bucket_size: An int that is > 1. The number of buckets. It should be bigger than maximum feature. In other words features in this column should be an int64 in range [0, bucket_size)
  • combiner: A string specifying how to reduce if the sparse column is multivalent. Currently "mean", "sqrtn" and "sum" are supported, with "sum" the default:
    • "sum": do not normalize features in the column
    • "mean": do l1 normalization on features in the column
    • "sqrtn": do l2 normalization on features in the column For more information: tf.embedding_lookup_sparse.
  • dtype: Type of features. It should be an integer type. Default value is dtypes.int64.

Returns:

An integerized _SparseColumn definition.

Raises:

  • ValueError: bucket_size is not greater than 1.
  • ValueError: dtype is not integer.

Defined in tensorflow/contrib/layers/python/layers/feature_column.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/sparse_column_with_integerized_feature