View source: R/layers-preprocessing.R
layer_discretization | R Documentation |
A preprocessing layer which buckets continuous features by ranges.
layer_discretization(
object,
bin_boundaries = NULL,
num_bins = NULL,
epsilon = 0.01,
output_mode = "int",
sparse = FALSE,
...
)
object |
What to compose the new
|
bin_boundaries |
A list of bin boundaries. The leftmost and rightmost bins
will always extend to |
num_bins |
The integer number of bins to compute. If this option is set,
|
epsilon |
Error tolerance, typically a small fraction close to zero (e.g. 0.01). Higher values of epsilon increase the quantile approximation, and hence result in more unequal buckets, but could improve performance and resource consumption. |
output_mode |
Specification for the output of the layer. Defaults to
|
sparse |
Boolean. Only applicable to |
... |
standard layer arguments. |
This layer will place each element of its input data into one of several contiguous ranges and output an integer index indicating which range each element was placed in.
Input shape:
Any tf.Tensor
or tf.RaggedTensor
of dimension 2 or higher.
Output shape: Same as input shape.
adapt()
https://www.tensorflow.org/api_docs/python/tf/keras/layers/Discretization
https://keras.io/api/layers/preprocessing_layers/numerical/discretization
Other numerical features preprocessing layers:
layer_normalization()
Other preprocessing layers:
layer_category_encoding()
,
layer_center_crop()
,
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.