fix(ml): circular sleep std, HRV battery fallback, running economy thresholds, stress 75/25 blend#201
Merged
Merged
Conversation
…resholds, stress 75/25 blend - Sleep consistency: replace linear std with circular (Rayleigh R) to avoid midnight-wrap artifact where 23:30 vs 00:30 would appear as 23h spread instead of 1h - Body battery: HRV fallback uses sleep_quality instead of fixed 0.5, removing artificial [52.5, 88] cap - Running economy: unify thresholds with activity.js UI — GCT 240ms, VO 80mm, VR 8% - Stress score: rebalance HRV/Garmin blend to 75/25 (was 60/40); Garmin stress is HRV-derived so over-weighting it would double-count the same signal - Tests: circular midnight-wrap, stress blend ratio, sleep consistency integration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sleep_qualityinstead of fixed0.5, removing the artificial [52.5, 88] score cap when no HRV data is availableTest plan
cd ml-service && .venv/bin/pytest tests/test_models.py -v— all new tests pass🤖 Generated with Claude Code