childmindresearch / wristpy

https://childmindresearch.github.io/wristpy/
GNU Lesser General Public License v2.1
5 stars 5 forks source link

Feature/issue 14/combined temperature acceleration nonwear detect #141

Open Asanto32 opened 3 weeks ago

Asanto32 commented 3 weeks ago

Resolves #14

This PR adds the combined temperature and acceleration (CTA) algorithm for non-wear detection.

TODO:

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.76%. Comparing base (d0e9226) to head (77b6d34).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #141 +/- ## ========================================== + Coverage 96.25% 96.76% +0.50% ========================================== Files 11 11 Lines 561 649 +88 ========================================== + Hits 540 628 +88 Misses 21 21 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Asanto32 commented 1 week ago

Currently, there is support for three non-wear detection algorithms. "GGIR", CTA, and scikit DETACH.

The CTA and DETACH provide much higher temporal resolution (one minute and sub-second, respectively) compared to the 15minute GGIR resolution. Additionally, due to their algorithmic implementation, DETACH is much better at catching the start of a non-wear period (see images below).

Greg has suggested implementing a majority vote to decide non-wear time. One immediate issue: we lose the temporal sensitivity gained from the DETACH algorithm (probably not necessary?). How to upscale the temporal information for the other two algorithms? Linearly interpolate and then simply truncate/round back to 0/1? I would think that is more accurate then just holding/filling with the previous value?

Screenshot 2024-11-13 at 3 14 13 PM Screenshot 2024-11-13 at 3 13 55 PM

Asanto32 commented 1 week ago

Additionally, have requested manually rated non-wear periods, we can use this dataset to inform our decision.

ReinderVosDeWael commented 6 days ago

Blocked on awaiting the manual ratings; if no movement on this by January 2025 ping again.