Commit graph

4 commits

Author SHA1 Message Date
ed4335b932 feat(tradein/estimator): calibrated 80% prediction interval for expected_sold range (#1966)
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
The expected_sold_range_low/high were derived from the analog asking-IQR
(× asking→sold ratio): only ~55% of actual sold prices fell inside the stated
range — a 50%-ish interval mislabeled as the estimate's range. Replace with a
calibrated band around the expected_sold POINT, gated behind
estimate_calibrated_pi_enabled (default ON):

  range_low  = expected_sold_price × 0.649  (empirical p10 of sold/expected_sold)
  range_high = expected_sold_price × 1.392  (empirical p90, n=2366 prod deals)

This is a genuine ~80% prediction interval (verified 80.0% coverage on the
2366-deal sample). Headline asking range_low/high (market-asking IQR) untouched.

Frozen backtest baseline regenerated: range_coverage.overall 55.23 → 80.14
(n_covered 153 → 222); expected_sold POINT mape/bias and headline unchanged
(only the band moved). Tests asserting the old asking-IQR × ratio band updated
to the calibrated band (documented behavior change).
2026-06-27 16:53:14 +03:00
ec82742456 feat(tradein): same-building anchor safe-guard (#755)
CLIENT-VISIBLE pricing (killer-factor, demo 2026-06-01). The same-building
anchor replaced headline median/range/confidence with an over-confident
premium on as few as 2 same-building asking comps. Human-chosen (Anton)
3-part safe-guard, all implemented:

1. min_comps 2 -> 4: anchor fires only with >=4 same-building comps.
2. confidence cap: at <5 anchor comps, confidence cannot be 'high' -> medium.
3. MAD-clip: drop price_per_m2 outliers among anchor comps before aggregation
   (k=estimate_sb_mad_k=3.5); if <min_comps survive, anchor does NOT fire
   (fallback to radius-median). Guards against price typos inflating anchor.

Anchor still REPLACES the headline (uplift-no-replace variant NOT chosen).
quarter-index/radius-tier/asking-sold untouched. 8 new unit tests; 61 anchor
tests pass, ruff clean.

MERGE-GATE (client-visible, like #764/#858): do NOT merge without a green
backtest #763 (held-out MAPE <= 18.7% + canonical A/B Малышева 125 /
Заводская 44а). Backtest needs live DB — pre-merge human/qa step.

Refs #755, #694
2026-05-31 12:19:50 +03:00
ec84637abf fix(estimator): expected_sold guard listings_clean → median_price>0 (Refs #773) (#784)
Some checks failed
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / test (push) Successful in 25s
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-backend (push) Successful in 39s
Deploy Trade-In / deploy (push) Has been cancelled
Co-authored-by: bot-backend <bot-backend@gendsgn.local>
Co-committed-by: bot-backend <bot-backend@gendsgn.local>
2026-05-30 16:39:08 +00:00
35bd0238ef feat(tradein): estimator additive expected_sold price (#648 S3) (#661)
All checks were successful
Deploy Trade-In / changes (push) Successful in 6s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 42s
Deploy Trade-In / deploy (push) Successful in 34s
2026-05-29 13:37:33 +00:00