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

Fill missing values issue and workaround #5

Closed
nachonacho2 opened this issue Dec 31, 2020 · 3 comments
Closed

Fill missing values issue and workaround #5

nachonacho2 opened this issue Dec 31, 2020 · 3 comments

Comments

@nachonacho2
Copy link

Hi,
In the analysis example notebook, 'fill missing values' incorrectly interpolates using other track data if present.
Instead of using locations = fill_missing(locations), my workaround is to call the function individually for each node, axis, and track (easier than writing a new interpolation function from scratch). For example, with my data (single node, 5 tracks):

fill_missing(locations[:, 0, 0, 0])
fill_missing(locations[:, 0, 1, 0])
fill_missing(locations[:, 0, 0, 1])
fill_missing(locations[:, 0, 1, 1])
fill_missing(locations[:, 0, 0, 2])
fill_missing(locations[:, 0, 1, 2])
fill_missing(locations[:, 0, 0, 3])
fill_missing(locations[:, 0, 1, 3])
fill_missing(locations[:, 0, 0, 4])
fill_missing(locations[:, 0, 1, 4])

On a related note, I'm wondering what was your reason for using cubic interpolation rather than linear?
Cheers

@talmo
Copy link
Member

talmo commented Jan 4, 2021

Hi @nachonacho2,

Happy new year and sorry about the delay!

Thanks for pointing this out. I think the behavior of the interpolation function might have changed with a recent scipy version (or we forgot to update the notebook) -- I'll make the changes to ensure that it works.

Regarding interpolation: this is a bit of an arbitrary decision (see relevant discussion in #6). I think here the reasoning was that linear interpolation would result in constant velocity, whereas cubic allows for a bit more "wiggliness" in the fit. That said, linear (or even nearest) is probably a safer general purpose interpolant for imputation. I'll change the default in the notebook.

Cheers,

Talmo

talmo added a commit that referenced this issue Jan 4, 2021
- Fix interpolation function (#5)
- Minor formatting
@talmo
Copy link
Member

talmo commented Jan 4, 2021

Analysis notebook updated and should take care of this issue, but feel free to re-open if you're still having trouble. Cheers!

@talmo talmo closed this as completed Jan 4, 2021
@nachonacho2
Copy link
Author

Happy New Year @talmo!
Thanks for the fix!
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants