From 4b32b263e1210a2b994819e8ed0772879e0f29d0 Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 24 May 2026 13:29:09 +0300 Subject: [PATCH] feat(tradein-estimator): exclude rosreestr deals from actual_deals output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rosreestr_deals contains застройщик DDU contracts (177-200 К/м²) that skew median for secondary-market valuation (~114 К/м²). Pass empty deals list to AggregatedEstimate; keep _fetch_deals() helper intact for future segmentation work. Source: estimate a0a0b820-e8a8-4eee-aa73-0ab3b98ac233 (deals median +40% vs analogs). --- tradein-mvp/backend/app/services/estimator.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tradein-mvp/backend/app/services/estimator.py b/tradein-mvp/backend/app/services/estimator.py index a6b54b26..0e6aad9a 100644 --- a/tradein-mvp/backend/app/services/estimator.py +++ b/tradein-mvp/backend/app/services/estimator.py @@ -402,8 +402,12 @@ async def estimate_quality( ) -> AggregatedEstimate: """Главная функция — оценка квартиры по реальным данным. + NOTE 2026-05-24: rosreestr_deals temporarily NOT included in actual_deals + output (they contain ДДУ first-market data that skews secondary-market + median). See Decision_TradeIn_DataQuality_8PR_Roadmap. + Returns: - AggregatedEstimate с estimate_id, медианой, диапазоном, аналогами, сделками. + AggregatedEstimate с estimate_id, медианой, диапазоном, аналогами. """ # 1. Geocode geo: GeocodeResult | None = None @@ -585,11 +589,11 @@ async def estimate_quality( except Exception as exc: logger.warning("cian_valuation: lookup failed (graceful): %s", exc) - # 5. Deals — фактические сделки за период - deals = _fetch_deals( - db, lat=geo.lat, lon=geo.lon, rooms=payload.rooms, area=payload.area_m2, - radius_m=DEFAULT_RADIUS_M, - ) + # 5. Deals — отключены 2026-05-24 (см. Decision_TradeIn_DataQuality_8PR_Roadmap). + # rosreestr_deals содержит ДДУ первичного рынка (177-200 К/м²), что искажает + # оценку вторички (~114 К/м²). Возвращаемся к этому когда отделим вторичные + # сделки от ДДУ в источнике. + deals: list[dict[str, Any]] = [] # 6. Сохраняем в trade_in_estimates estimate_id = uuid4() -- 2.45.3