Model/tests/domain/epc_prediction
Khalim Conn-Kowlessar 4afab2c3d8 feat(epc-prediction): roof-insulation +/-1-bucket reporting
Adds roof_insulation_thickness_pm1 (mirrors construction_age_band_pm1, issue
#1222): adjacent RdSAP thickness buckets (0/NI,12mm..400mm+) carry near-
identical roof U-values, so an off-by-one bucket is a SAP-neutral hit. 'ND'
(no-data) is off the ordered scale, so only an exact match counts there.
Honest measurement of SAP-relevant roof-insulation quality.

Corpus (150pc/514): exact 49.3% -> +/-1 53.7% (the misses are often multiple
buckets or ND, so the band gain is smaller than age's). Fixture: exact ==
+/-1 (0.4118) — its misses are all >1 bucket; gate floor added at 0.4118.

Also fixes two pre-existing pyright errors in the touched test file
(_epc main_fuel_type/main_heating_control were Optional but the
MainHeatingDetail attributes are non-optional Union[int, str]).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 14:04:18 +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): roof-insulation +/-1-bucket reporting 2026-06-15 14:04:18 +00:00
test_epc_prediction.py feat(epc-prediction): coherent heating donor selection (#1225) 2026-06-15 13:48:15 +00:00
test_prediction_comparison.py feat(epc-prediction): roof-insulation +/-1-bucket reporting 2026-06-15 14:04:18 +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