Skip to content

Implement a keras layer to round numeric values and truncate values with a max value. #1841

Closed
@workingloong

Description

@workingloong

For numeric features, we may want to convert the values to integer id by rounding and then make embedding with those ids. Though we can implement the function by using bucketing with boundaries where 1 interval,it is tedious to set the boundaries and inefficient to transform if the max value is big.

Example:
inputs: [[1.2], [4.1], [6.7], [100.1]]
max_value: 50
default_value: 50
the outputs: [[1], [4], [7], [50]]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions