CategoricalColumn - Maple Help

DeepLearning

 CategoricalColumn
 categorical feature column

 Calling Sequence CategoricalColumn(key,categories,opts)

Parameters

 key - string; label for feature column categories - list of strings or integers; category values in input opts - zero or more options as specified below

Options

 • datatype=one of integer[4],integer[8], or string

The value of option datatype specifies the type of data this column will hold.

Description

 • 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](..).

Details

 • 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.

Examples

Define a feature which takes one or four color names.

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{fc}≔\mathrm{CategoricalColumn}\left("color",\left["red","white","blue","green"\right]\right)$
 ${\mathrm{fc}}{≔}\left[\begin{array}{c}{\mathrm{Feature Column}}\\ {\mathrm{VocabularyListCategoricalColumn\left(key=\text{'}color\text{'}, vocabulary_list=\left(\text{'}red\text{'}, \text{'}white\text{'}, \text{'}blue\text{'}, \text{'}green\text{'}\right), dtype=tf.string, default_value=-1, num_oov_buckets=0\right)}}\end{array}\right]$ (1)

Compatibility

 • The DeepLearning[CategoricalColumn] command was introduced in Maple 2018.