Model/tests/domain/epc_prediction
Khalim Conn-Kowlessar d762b25808 feat(epc-prediction): recency-weighted glazing mode (#1223)
Per-component method: glazing type is now the recency-weighted cohort mode
applied to every predicted window, rather than copied from the template.
Glazing is retrofitted over a dwelling's life (single -> double), so a
recent neighbour reflects the current state — same family as roof-insulation
thickness. Recency is the CORRECT weighting here: plain moding regressed the
fixture (-5.6pp) and was previously reverted; similarity weighting also
regressed it; recency improves BOTH (window geometry stays on the template,
only the glazing categorical moves).

modal_glazing_type: corpus (150pc/514) 60.7 -> 66.7% (+6.0pp); fixture
0.5000 -> 0.5278 (floor ratcheted up). Heating, geometry residuals and all
other components unchanged. Refactored _recency_weighted_mode to a reusable
_recency_weighted_choice(value_of) shared by roof insulation + glazing.

Closes the #1223 per-component approach: floor-area (median estimate) +
glazing (recency) shipped as distinct best-fit methods rather than a global
recency template, which would have disturbed the coherence-coupled heating
cluster.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 13:35:03 +00:00
..
__init__.py feat(epc-prediction): Comparable Properties selection ladder (ADR-0029) 2026-06-13 23:44:57 +00:00
test_comparable_properties.py fix(epc-prediction): dedupe re-lodgements + leak-free leave-one-out (ADR-0029) 2026-06-14 00:40:23 +00:00
test_component_accuracy_gate.py feat(epc-prediction): recency-weighted glazing mode (#1223) 2026-06-15 13:35:03 +00:00
test_epc_prediction.py feat(epc-prediction): recency-weighted glazing mode (#1223) 2026-06-15 13:35:03 +00:00
test_prediction_comparison.py feat(epc-prediction): ±1-band age scoring + window_count cosmetic (#1222) 2026-06-14 10:01:20 +00:00
test_validation.py refactor(epc-prediction): extract shared leave-one-out scorer + corpus loader (ADR-0030) 2026-06-14 09:12:08 +00:00