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

Tag/detect drift #303

Open
cdemulde opened this issue Jul 3, 2018 · 3 comments
Open

Tag/detect drift #303

cdemulde opened this issue Jul 3, 2018 · 3 comments

Comments

@cdemulde
Copy link
Member

cdemulde commented Jul 3, 2018

Write a function detecting drift in the data. The idea would be that the user gives:

  • a range in which to apply the function (similar to other tagging functions)
  • the maximum slope a signal is expected to have over a certain period (see below)
  • the period over which a certain slope is allowed

This function could calculate the slope of the data in a certain given period (by for example fitting a line through it) and compare it with the maximum expected slope. In first instance, it would be interesting for the user to know if drift is present, secondly it would be good to be able to correct for it.

Some additional sources of information/inspiration:

@jorasinghr could you have a look at this and let me know if things are unclear?

@cdemulde
Copy link
Member Author

Looking good! Some ideas for further work on this:

  • Apply the currently implemented detect_drift function iteratively over a complete dataset (so over day 0 to 5, over day 1 to 6, over day 2 to 7 etc.) to not only detect if there is drift in a certain period, but to detect any drift at all in a dataset. User output would then be something like: drift detected in period ... to ...
  • Once the detection is done, the scipy.detrend function can be used in another function to actually remove the drift from a timeseries. When this is done, tags need to be added to the self.meta_filled dataset, indicating that the original values were changed at certain indexes.
  • Since I don't expect drift to be present in the current testing dataset, might be good to create one where we introduce some artificial drift and see if the functions successfully pick it up/remove it.

jorasinghr added a commit that referenced this issue Jul 12, 2018
jorasinghr added a commit that referenced this issue Jul 13, 2018
jorasinghr added a commit that referenced this issue Jul 13, 2018
jorasinghr added a commit that referenced this issue Jul 26, 2018
jorasinghr added a commit that referenced this issue Jul 31, 2018
jorasinghr added a commit that referenced this issue Aug 27, 2018
@cdemulde
Copy link
Member Author

Thanks for your work on this @jorasinghr! I'll have a closer look as soon as I can, but I can already tell this has been a great help!

@cdemulde
Copy link
Member Author

cdemulde commented Sep 3, 2018

Both tagging and removing function are good to go, only some additional testing still needs to be done:

  • Downward drift
  • Real data with drift
  • Longer dataset

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

No branches or pull requests

1 participant