Skip to content
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

Support specifying missing value for tensor.tosparse() #1795

Closed
qinxuye opened this issue Dec 17, 2020 · 4 comments · Fixed by #1797
Closed

Support specifying missing value for tensor.tosparse() #1795

qinxuye opened this issue Dec 17, 2020 · 4 comments · Fixed by #1797

Comments

@qinxuye
Copy link
Collaborator

qinxuye commented Dec 17, 2020

Is your feature request related to a problem? Please describe.

For now, tensor.tosparse() will just treat 0 as missing value, we can allow specifying another missing value.

Describe the solution you'd like

e.g. support tensor.tosparse(missing=np.nan).

@qinxuye qinxuye added this to the v0.7.0a2 milestone Dec 17, 2020
@qinxuye qinxuye added this to To do in Tensor via automation Dec 17, 2020
@qinxuye qinxuye added this to Issue-Needs prioritizing in v0.7 Release via automation Dec 17, 2020
@smartguo
Copy link
Contributor

smartguo commented Dec 17, 2020

can we set missing with multiple values? For example, tensor.tosparse(missing=[np.nan, -9999])

@qinxuye
Copy link
Collaborator Author

qinxuye commented Dec 17, 2020

can we set missing with multiple values? For example, tensor.tosparse(missing=[np.nan, -9999])

Do you mean the value that is nan or -9999 will be treated as missing value?

@smartguo
Copy link
Contributor

can we set missing with multiple values? For example, tensor.tosparse(missing=[np.nan, -9999])

Do you mean the value that is nan or -9999 will be treated as missing value?

Yes. But we can replace other value such as -9999 into np.nan in advance, I'm not sure which operation is better.

@qinxuye
Copy link
Collaborator Author

qinxuye commented Dec 17, 2020

can we set missing with multiple values? For example, tensor.tosparse(missing=[np.nan, -9999])

Do you mean the value that is nan or -9999 will be treated as missing value?

Yes. But we can replace other value such as -9999 into np.nan in advance, I'm not sure which operation is better.

OK, I have already implemented it, missing can be multiple values, any of them will be treated as missing value.

Tensor automation moved this from To do to Done Dec 17, 2020
v0.7 Release automation moved this from Issue-Needs prioritizing to PR-Done Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Tensor
  
Done
2 participants