# tf.feature_column.indicator_column

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/feature_column/feature_column_v2.py#L1679-L1719) |

Represents multi-hot representation of given categorical column.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.feature_column.indicator_column`](https://www.tensorflow.org/api_docs/python/tf/feature_column/indicator_column)

<br />

    tf.feature_column.indicator_column(
        categorical_column
    )

- For DNN model, `indicator_column` can be used to wrap any
  `categorical_column_*` (e.g., to feed to DNN). Consider to Use
  `embedding_column` if the number of buckets/unique(values) are large.

- For Wide (aka linear) model, `indicator_column` is the internal
  representation for categorical column when passing categorical column
  directly (as any element in feature_columns) to `linear_model`. See
  `linear_model` for details.

    name = indicator_column(categorical_column_with_vocabulary_list(
        'name', ['bob', 'george', 'wanda']))
    columns = [name, ...]
    features = tf.io.parse_example(..., features=make_parse_example_spec(columns))
    dense_tensor = input_layer(features, columns)

    dense_tensor == [[1, 0, 0]]  # If "name" bytes_list is ["bob"]
    dense_tensor == [[1, 0, 1]]  # If "name" bytes_list is ["bob", "wanda"]
    dense_tensor == [[2, 0, 0]]  # If "name" bytes_list is ["bob", "bob"]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `categorical_column` | A `CategoricalColumn` which is created by `categorical_column_with_*` or `crossed_column` functions. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An `IndicatorColumn`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `categorical_column` is not CategoricalColumn type. |

<br />