-
Notifications
You must be signed in to change notification settings - Fork 14
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
Handles NaN's #30
Handles NaN's #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to go!
Maybe it would be interesting to open an issue here, in DeepEcho, explaining the lack of support for np.nan
and pointing at it from this PR, just to make everything consistent and keep track of the change.
@@ -210,17 +210,23 @@ def _data_to_tensor(self, data): | |||
|
|||
elif props['type'] in ['continuous', 'timestamp']: | |||
mu_idx, sigma_idx, missing_idx = props['indices'] | |||
x[mu_idx] = 0.0 if (data[key][i] is None or props['std'] == 0) else ( | |||
data[key][i] - props['mu']) / props['std'] | |||
if pd.isnull(data[key][i]) or props['std'] == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change from one-liner to if / else block!
It improves readability a lot, in this case.
This PR has two purposes:
Resolves ValueError: The parameter loc has invalid values SDV#353. In that issue the user was passing NaN`s to SDV, and in turn SDV was passing them to DeepEcho, which was unable to handle them. This PR addresses this.
Update dependency versions. Since no one has worked on DeepEcho in a while, the latest versions of some libraries became incompatible. This PR caps those dependencies to working versions.
Resolves #35.