layer_category_encoding {keras} | R Documentation |
A preprocessing layer which encodes integer features.
Description
This layer provides options for condensing data into a categorical encoding
when the total number of tokens are known in advance. It accepts integer
values as inputs, and it outputs a dense or sparse representation of those
inputs. For integer inputs where the total number of tokens is not known, use
layer_integer_lookup()
instead.
Usage
layer_category_encoding(
object,
num_tokens = NULL,
output_mode = "multi_hot",
sparse = FALSE,
...
)
Arguments
object |
What to compose the new
|
num_tokens |
The total number of tokens the layer should support. All
inputs to the layer must integers in the range |
output_mode |
Specification for the output of the layer. Defaults to
For all output modes, currently only output up to rank 2 is supported. |
sparse |
Boolean. If |
... |
standard layer arguments. |
See Also
-
https://www.tensorflow.org/api_docs/python/tf/keras/layers/CategoryEncoding
-
https://keras.io/api/layers/preprocessing_layers/categorical/category_encoding/
Other categorical features preprocessing layers:
layer_hashing()
,
layer_integer_lookup()
,
layer_string_lookup()
Other preprocessing layers:
layer_center_crop()
,
layer_discretization()
,
layer_hashing()
,
layer_integer_lookup()
,
layer_normalization()
,
layer_random_brightness()
,
layer_random_contrast()
,
layer_random_crop()
,
layer_random_flip()
,
layer_random_height()
,
layer_random_rotation()
,
layer_random_translation()
,
layer_random_width()
,
layer_random_zoom()
,
layer_rescaling()
,
layer_resizing()
,
layer_string_lookup()
,
layer_text_vectorization()