A preprocessing layer which buckets continuous features by ranges.
layer_discretization( object, bin_boundaries = NULL, num_bins = NULL, epsilon = 0.01, ... )
What to compose the new
Layer instance with. Typically a
Sequential model or a Tensor (e.g., as returned by
The return value depends on
Layer instance is returned.
Sequential model, the model with an additional layer is returned.
a Tensor, the output tensor from
layer_instance(object) is returned.
A list of bin boundaries. The leftmost and rightmost bins
will always extend to
bin_boundaries = c(0., 1., 2.)
[1., 2.), and
[2., +Inf). If
this option is set,
adapt should not be called.
The integer number of bins to compute. If this option is set,
adapt should be called to learn the bin boundaries.
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.
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.
tf.RaggedTensor of dimension 2 or higher.
Output shape: Same as input shape.
Other numerical features preprocessing layers:
Other preprocessing layers: