tensorflow/python/feature_column/feature_column.py
def categorical_column_with_hash_bucket(key,
                                        hash_bucket_size,
                                        dtype=dtypes.string):
  """Represents sparse feature where ids are set by hashing.

  Use this when your sparse features are in string or integer format where you
  want to distribute your inputs into a finite number of buckets by hashing.
  output_id = Hash(input_feature_string) % bucket_size

  Example:

  ```python
  keywords = categorical_column_with_hash_bucket("keywords", 10K)
  all_feature_columns = [keywords, ...]
  linear_prediction = make_linear_model(features, all_feature_columns)

  # or
  keywords_embedded = embedding_column(keywords, 16)
  all_feature_columns = [keywords_embedded, ...]
  dense_tensor = make_input_layer(features, all_feature_columns)
  ```

  Args:
    key: A string providing key to look up corresponding `Tensor`.
    hash_bucket_size: An int > 1. The number of buckets.
    dtype: The type of features. Only string and integer types are supported.

  Returns:
    A `_CategoricalColumnHashed`.

  Raises:
    ValueError: `hash_bucket_size` is not greater than 1.
    ValueError: `dtype` is neither string nor integer.
  """
  if hash_bucket_size is None:
    raise ValueError('hash_bucket_size must be set. ' 'key: {}'.format(key))

  if hash_bucket_size < 1:
    raise ValueError('hash_bucket_size must be at least 1. '
                     'hash_bucket_size: {}, key: {}'.format(
                         hash_bucket_size, key))

  if dtype != dtypes.string and not dtype.is_integer:
    raise ValueError('dtype must be string or integer. '
                     'dtype: {}, column_name: {}'.format(dtype, key))

  return _CategoricalColumnHashed(key, hash_bucket_size, dtype)
Represents sparse feature where ids are set by hashing.

  Use this when your sparse features are in string or integer format where you
  want to distribute your inputs into a finite number of buckets by hashing.
  output_id = Hash(input_feature_string) % bucket_size

  Example:

  ```python
  keywords = categorical_column_with_hash_bucket("keywords", 10K)
  all_feature_columns = [keywords, ...]
  linear_prediction = make_linear_model(features, all_feature_columns)

  # or
  keywords_embedded = embedding_column(keywords, 16)
  all_feature_columns = [keywords_embedded, ...]
  dense_tensor = make_input_layer(features, all_feature_columns)
  ```

  Args:
    key: A string providing key to look up corresponding `Tensor`.
    hash_bucket_size: An int > 1. The number of buckets.
    dtype: The type of features. Only string and integer types are supported.

  Returns:
    A `_CategoricalColumnHashed`.

  Raises:
    ValueError: `hash_bucket_size` is not greater than 1.
    ValueError: `dtype` is neither string nor integer.
  
Represents sparse feature where ids are set by hashing.
Use this when your sparse features are in string or integer format where you
want to distribute your inputs into a finite number of buckets by hashing.
Represents sparse feature where ids are set by hashing . Use this when your sparse features are in string or integer format where you want to distribute your inputs into a finite number of buckets by hashing .
def categorical_column_with_hash_bucket(key,
                                        hash_bucket_size,
                                        dtype=dtypes.string):
  if hash_bucket_size is None:
    raise ValueError('hash_bucket_size must be set. ' 'key: {}'.format(key))
  if hash_bucket_size < 1:
    raise ValueError('hash_bucket_size must be at least 1. '
                     'hash_bucket_size: {}, key: {}'.format(
                         hash_bucket_size, key))
  if dtype != dtypes.string and not dtype.is_integer:
    raise ValueError('dtype must be string or integer. '
                     'dtype: {}, column_name: {}'.format(dtype, key))
  return _CategoricalColumnHashed(key, hash_bucket_size, dtype)
def categorical_column_with_hash_bucket ( key , hash_bucket_size , dtype = dtypes . string ) : if hash_bucket_size is None : raise ValueError ( 'hash_bucket_size must be set. ' 'key: {}' . format ( key ) ) if hash_bucket_size < 1 : raise ValueError ( 'hash_bucket_size must be at least 1. ' 'hash_bucket_size: {}, key: {}' . format ( hash_bucket_size , key ) ) if dtype != dtypes . string and not dtype . is_integer : raise ValueError ( 'dtype must be string or integer. ' 'dtype: {}, column_name: {}' . format ( dtype , key ) ) return _CategoricalColumnHashed ( key , hash_bucket_size , dtype )
Represents sparse feature where ids are set by hashing.
Represents sparse feature where ids are set by hashing .
"""Represents sparse feature where ids are set by hashing.

  Use this when your sparse features are in string or integer format where you
  want to distribute your inputs into a finite number of buckets by hashing.
  output_id = Hash(input_feature_string) % bucket_size

  Example:

  ```python
  keywords = categorical_column_with_hash_bucket("keywords", 10K)
  all_feature_columns = [keywords, ...]
  linear_prediction = make_linear_model(features, all_feature_columns)

  # or
  keywords_embedded = embedding_column(keywords, 16)
  all_feature_columns = [keywords_embedded, ...]
  dense_tensor = make_input_layer(features, all_feature_columns)
  ```

  Args:
    key: A string providing key to look up corresponding `Tensor`.
    hash_bucket_size: An int > 1. The number of buckets.
    dtype: The type of features. Only string and integer types are supported.

  Returns:
    A `_CategoricalColumnHashed`.

  Raises:
    ValueError: `hash_bucket_size` is not greater than 1.
    ValueError: `dtype` is neither string nor integer.
  """
None
`hash_bucket_size` is not greater than 1.
` hash_bucket_size ` is not greater than 1 .
ValueError
`dtype` is neither string nor integer.
` dtype ` is neither string nor integer .
ValueError
key
A string providing key to look up corresponding `Tensor`.
A string providing key to look up corresponding ` Tensor ` .
hash_bucket_size
An int > 1. The number of buckets.
An int > 1 . The number of buckets .
dtype
The type of features. Only string and integer types are supported.
The type of features . Only string and integer types are supported .
examples
None