mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Size the predicted dwelling from the geo-proximity-weighted median of the cohort's floor areas rather than the plain median: homes built together share a footprint, so a nearer neighbour's area should count for more (the same street signal #1227 already wired into age / wall / glazing). Reuses `_geo_weights` and adds `_weighted_median`, which reduces exactly to `statistics.median` under uniform weights (geo off / no target coordinates) — including the even-count midpoint average — so the MAD-minimising guarantee is preserved. Measured over the 514-target SAP-10.2 corpus (leave-one-out): floor_area MAE 10.48 -> 9.73 m² MAPE 13.2% -> 12.2% Re-baselines the n=36 fixture floor_area ceiling 11.8983 -> 12.0378 (a method change, not a loosening; the small fixture subset moved +0.14 the other way as sample noise while the population improved decisively). The ceiling still pins the new deterministic value exactly, so the tighten-only ratchet resumes. Investigation ruling out the adjacent floor-area levers (kept in the follow-up): lowering minimum_cohort (9.78-10.03, worse), hard same-form filter (10.19), mean instead of median (10.68), constant bias correction (10.47), extension-conditioning (oracle 9.50, not worth the misclassification cost) and room-in-roof conditioning/additive (RiR is a confound for large multi-part outliers — RiR area is only ~21% of total, and the increment breaks the homes already predicted exactly). Remaining cohort lever is built-form soft-weighting, gated on a denser corpus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| comparable_properties.py | ||
| epc_prediction.py | ||
| prediction_comparison.py | ||
| validation.py | ||