Improve calibration weight initialization with country-aware divisors#262
Merged
Conversation
Use country-aware initialization for calibration weights. Previously, each household's weight was divided by total area count (e.g., 650 for constituencies), causing Scottish households to start at ~9% of their target (59/650). Now weights are divided by areas in that household's country, so all countries start at ~100% of their targets. This should improve convergence speed and final accuracy for Scotland, Wales, and Northern Ireland specific targets like Scottish Child Payment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
Experiment resultsCompared calibration logs from CI runs with 30 epochs. Overall accuracy (targets within 10% of goal)
Scottish Child Payment convergence
The new initialization reaches target by epoch 10 vs epoch 30+. Some overshoot at epoch 30 would resolve with production's 512 epochs. Why it helpsThe country mask
This caused Scotland to start at 59/650 ≈ 9% of target. Now we divide by the actual number of constituencies in each household's country, so all countries start at ~100%. |
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
Problem
At epoch 0, Scottish targets were starting at ~10% of target because:
This caused slow convergence and potentially suboptimal final results for devolved nation targets.
Solution
Use the country mask
rto compute areas per household:Expected Results
This should result in faster convergence and better final accuracy, especially for Scotland, Wales, and Northern Ireland specific targets.
Test plan
🤖 Generated with Claude Code