spaxel/mothership/internal/learning
jedarden f7b9719d1b feat(localization): implement self-improving localization with BLE ground truth
Implement a complete self-improving localization system that uses BLE
RSSI triangulation as ground truth to learn per-link, per-zone weights
for the Fresnel zone fusion engine.

Key components:
- Ground truth sample collection with confidence > 0.7 and distance < 0.5m gates
- Spatial weight learner using online SGD with L2 regularization
- Validation gate that rejects updates without 5% improvement on holdout set
- Bilinear interpolation for smooth weight transitions between zones
- SQLite persistence for weights with 10,000 sample cap per person
- Position accuracy trend visualization in dashboard Accuracy panel

Backend (mothership/internal/localization/):
- groundtruth.go: BLE trilateration provider with Gauss-Newton optimization
- groundtruth_store.go: SQLite storage with weekly accuracy rollups
- spatial_weights.go: SpatialWeightLearner with SGD, validation, interpolation
- weightlearner.go: WeightLearner with error history tracking
- weightstore.go: Weight persistence to SQLite

Frontend (dashboard/js/accuracy.js):
- fetchPositionAccuracy/fetchPositionHistory functions
- drawPositionSparkline for weekly median error trend
- Position accuracy section with median error, trend indicator, sample count

Tests cover:
- Sample collection gates (confidence/distance thresholds)
- SGD weight updates after 100 samples
- Validation gate rejection of adversarial samples
- Bilinear interpolation smoothness
- SQLite sample cap enforcement
- Weight persistence across restarts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:11:22 -04:00
..
accuracy.go feat(learning): complete feedback loop with time-range queries and zone breakdown 2026-03-29 18:03:45 -04:00
feedback_processor.go feat(learning): implement detection feedback loop and accuracy tracking 2026-03-29 14:50:36 -04:00
feedback_store.go feat(learning): complete feedback loop with time-range queries and zone breakdown 2026-03-29 18:03:45 -04:00
feedback_test.go feat(learning): implement detection feedback loop and accuracy tracking 2026-03-29 14:50:36 -04:00
handler.go feat(localization): implement self-improving localization with BLE ground truth 2026-03-29 20:11:22 -04:00