feat: density-based activity classifier and data import/export#1
Merged
feat: density-based activity classifier and data import/export#1
Conversation
Export now includes sensor windows alongside steps, transitions, and cycling sessions. Import parses the same JSON format and batch-inserts all records, enabling data migration between app variants (e.g. production → dev) without raw DB access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the consecutive-window walking classifier with a density-based approach that counts walking-quality windows (hz >= 1.5) within a 5-minute rolling window. This tolerates accelerometer throttling gaps that previously broke walking detection entirely. Key changes: - Walking entry: 5 windows with hz >= 1.5 in 5 min (was: 36 consecutive) - Walking exit: density drops below 2, or 2 min still grace period - Cycling entry: 6 consecutive windows (was: 2) + 60s duration gate - Cycling exit: 8 consecutive windows with hz >= 2.0 (filters road vibration false step events at 0.4-1.8 Hz) - Evaluation interval: 30s (was: 5s), aligned with step frequency window - Accelerometer buffer: 150 samples / 30s (was: 75 / 15s) - DB migration v2→v3: consolidates existing 5s sensor windows into 30s by keeping highest-variance window per 30s slot Validated against real sensor data: correctly detects a 17-min walk and a 60-min bike ride with zero false positives from indoor chores. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Validated against real sensor data
Test plan
🤖 Generated with Claude Code