feat(tradein): per-cadastral-quarter price index in estimator (#764) #858

Merged
bot-reviewer merged 1 commit from feat/764-quarter-price-index into main 2026-05-31 06:53:22 +00:00

1 commit

Author SHA1 Message Date
a749151679 feat(tradein): per-cadastral-quarter price index in estimator (#764)
Apply quarter_price_index (FDW) via gap-correction to avoid double-counting
location already encoded in the analog median:
  adjusted_ppm2 = base_median_ppm2 × (target_index / avg_analog_index)
median_price/range_low/range_high scale by the same factor.

Guards (no double-count + no regression):
- feature flag estimate_quarter_index_enabled (default on)
- pure-radius path only: skip if same-building anchor fired (anchor_tier)
  or any Avito IMV anchor influenced median/range (imv_anchor_present)
- Guard-2: skip when >0.6 of analogs share the target quarter
- sparse fallback: no row / n_deals<10 / FDW error → no-op
- bimodal guard: price_index>2.0 & n_deals<50 → no-op (heterogeneous quarters)

Analog quarter from listings.building_cadastral_number (added to analog
SELECT); target quarter from dadata.house_cadnum. Batched single FDW lookup
for analog indexes. Disclosure appended to confidence_explanation.

Refs #764
2026-05-31 09:49:59 +03:00