feat(training): trained-weights overview with per-fit reach#10
Merged
Conversation
The training page now lists every location with stored trained weights on the device, and a fit can declare a reach radius so its weights apply to nearby locations that have no fit of their own. Reach resolution lives behind the existing loadWeights(lat, lon) chokepoint: the exact grid cell still wins, otherwise the nearest training location whose reach covers the point is used (uniform within the radius, hard cutoff). The live forecast and the verification "Aggregate (tuned)" row inherit this for free. StoredWeights gains an optional location + radiusKm; pre-reach entries fall back to their grid cell and "this point only". Assisted-by: ClaudeCode:claude-opus-4-8
Wrap the training flow and the device-wide weights overview in the same CollapsibleSection component the forecast and verification pages use, so all three surfaces share one heading style and collapse behaviour. The page-level <h1>/<h2> give way to the section titles; the location and the stored-fit count surface as header summaries while collapsed. Assisted-by: ClaudeCode:claude-opus-4-8
⛅ Preview deploymentThis PR is live at https://preview-ee636ede-meteocompare.frcy.workers.dev Commit |
Add title tooltips explaining the Train/val, Heuristic (val), Trained (val) and Improvement fit stats, and show a pointer cursor on the overview's jump-to-location button so it reads as clickable. Assisted-by: ClaudeCode:claude-opus-4-8
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.
What
Adds two things to the training page (
/train), then refactors its layout to match the rest of the app.1. Device-wide trained-weights overview
A new section at the bottom of the page lists every location with a stored fit on the device (scanning
meteocompare:weights:*): name, trained date, out-of-sample improvement, count of models actually tuned, an inline reach selector, jump-to navigation, and Clear. Current location sorts first.2. Per-fit "reach"
A stored fit can now declare a reach radius (This point only / 25 / 50 / 100 / 250 km) so its trained weights also apply to nearby locations that have no fit of their own.
Resolution lives entirely behind the existing
loadWeights(lat, lon)chokepoint:Because it's behind
loadWeights, the live forecast and the verification "Aggregate (tuned)" row inherit it for free.3. Collapsible-heading refactor
/trainnow uses the sameCollapsibleSectioncomponent as the forecast and verification pages. The page-level<h1>/<h2>give way to section titles; the location and the stored-fit count surface as header summaries while collapsed.Why
Closes the gap where a fit trained at one location couldn't benefit nearby points, and gives users a single place to see/manage every fit. The refactor unifies heading/collapse behaviour across all three pages.
Notes for reviewers
StoredWeightsgains optionallocation: {name, detail?, latitude, longitude}+radiusKm. Pre-existing entries (no location/radius) fall back to their grid-cell center and this point only, so they keep working unchanged.CONTEXT.md(Trained weights / Training location / Reach), deliberately avoidingcoverageandregionwhich are already taken. No ADR — treated as an extension of ADR 0007.src/domain/geo.tshaversineKmhelper for the radius test.Verification
npm run lint,npm run type-check,npm testall green (164 tests, incl. 8 new for reach/precedence/management + 4 for haversine).Assisted-by: ClaudeCode:claude-opus-4-8