97 task write trails velocity feature functions detect hesitations correct#117
Conversation
…ons-calculate_segment_velocity_metrics
… class but will be calculated outside for sake of simplicity
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
==========================================
+ Coverage 98.59% 98.61% +0.01%
==========================================
Files 19 19
Lines 1067 1080 +13
==========================================
+ Hits 1052 1065 +13
Misses 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ons-detect_hesitations_correct
Asanto32
left a comment
There was a problem hiding this comment.
Looks good, just some documentation fixes, and resolving issues in models and test that came from the merge (old version)
| hesitations = self.velocities < threshold | ||
|
|
||
| hesitation_changes = np.diff(hesitations.astype(int)) | ||
| hesitation_starts = np.where(hesitation_changes == 1)[0] + 1 |
There was a problem hiding this comment.
What's the +1 for? I would assume the +1 for the start is covered by the if statement below?
There was a problem hiding this comment.
+1 handles when the linesegment starts with a hesitation
Asanto32
left a comment
There was a problem hiding this comment.
lgtm, just see the change to hesitation_count computation I suggested
Co-authored-by: Adam Santorelli <148909356+Asanto32@users.noreply.github.com>
This pr completes #97 and #98
detect_hesitations is a classmethod that defines a hesitation as any period where the velocity falls below a certain threshold, which is determined by the specified percentile of the velocity distribution. It counts the number of distinct hesitation periods and adds 1 if the line starts with a hesitation. It also calculates the total duration of hesitations based on the number of points that fall below the threshold and the time interval between points.