DeepLearning
CategoricalColumn
categorical feature column
Calling Sequence
Parameters
Options
Description
Details
Examples
Compatibility
CategoricalColumn(key,categories,opts)
key
-
string; label for feature column
categories
list of strings or integers; category values in input
opts
zero or more options as specified below
datatype=one of integer[4],integer[8], or string
The value of option datatype specifies the type of data this column will hold.
The CategoricalColumn(c) command creates a feature column to represent categorical data, data whose values are taken from some finite set known in advance, consisting of strings and integer values.
This function is part of the DeepLearning package, so it can be used in the short form CategoricalColumn(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[CategoricalColumn](..).
The implementation of CategoricalColumn uses the tf.feature_column.categorical_column_with_vocabulary_list command from the TensorFlow Python API Documentation. Consult the TensorFlow API documentation for tf.feature_column.categorical_column_with_vocabulary_list for more information.
Define a feature which takes one or four color names.
with⁡DeepLearning:
fc≔CategoricalColumn⁡color,red,white,blue,green
fc≔Feature ColumnVocabularyListCategoricalColumn(key='color', vocabulary_list=('red', 'white', 'blue', 'green'), dtype=tf.string, default_value=-1, num_oov_buckets=0)
The DeepLearning[CategoricalColumn] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
DNNClassifier
Feature Column
Download Help Document