Skip to content

Layer to convert Tensor to SparseTensor dropping ignore values #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 26, 2020

Conversation

workingloong
Copy link
Collaborator

Fix #1844

Arguments:
ignore_value: Entries in inputs equal to this value will be
absent from the output `SparseTensor`. If `None`, default value of
inputs dtype will be used ('' for `str`, -1 for `int`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expose this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 for int seems dangerous as this is application specific

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 for int is the default value and the layer will ignore it during transformation.

Copy link
Collaborator

@brightcoder01 brightcoder01 Mar 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 for int seems dangerous as this is application specific

Use -1 as the default ignore_value for int type is also the implementation inside feature column. Please check the code snippet.

@brightcoder01 brightcoder01 merged commit 29a8060 into sql-machine-learning:develop Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support convert categorical features to SparseTensor for embedding in Keras
4 participants