feat(tradein/backtest): --city per-city валидация точности + corridor city-parity #2491
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#2491
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/tradein-oblast-d-backtest"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Что
D validation harness — измерять точность оценщика по городам после oblast-расширения.
Изменения (scripts/backtest_estimator.py + tests)
--city '<точное deals.city>'(напр.--city "Нижний Тагил") → скоуп выборки поdeals.city. Default None = байт-идентично (тот же_SAMPLE_SQLobject — literal identity, залочено тестом).deal_city_price_bands(fallback global, 0 доп-запросов при None)._fetch_dkp_corridorтеперь передаётcity=_resolve_target_city(deal.address)— зеркалит прод (C2). Раньше backtest считал коридоры cross-city-contaminated (не как прод). ⚠️ Это меняет и default-run live-числа (не fixture-replay) — intended catch-up к проду; MAPE до/после этого PR напрямую не сравнимы для default-прогонов._compute_confidenceподтверждён comp-count-based (без EKB-хардкода) — code change не нужен._sample_sql(None) is _SAMPLE_SQL, city-predicate, per-city band no-DB/found/missing/error, corridor city передан).Проверка
_fetch_dkp_corridor). Frozen fixture/baseline не тронуты. ruff clean.После merge (я прогоню)
Live per-city backtest
docker exec tradein-backend python -m scripts.backtest_estimator --city "<город>"для target-городов → per-city MAPE report (валидация oblast-точности).D validation harness для oblast-точности: - --city '<точное deals.city>' → scope выборки по deals.city; default None = байт-идентично (тот же _SAMPLE_SQL object, literal identity). - per-city PPM2 band из deal_city_price_bands (fallback global, 0 доп-запросов при None). - corridor city-parity: backtest _fetch_dkp_corridor теперь передаёт city=_resolve_target_city(deal.address) — зеркалит прод C2 (был cross-city contaminated). NB: меняет и default-run live-числа (не fixture-replay) — intended catch-up к проду. - _compute_confidence подтверждён comp-count-based (без EKB-хардкода). - +10 unit-тестов. Регресс-гейт байт-зелёный (replay не гоняет corridor). code-review ✅ APPROVE. Frozen fixture/baseline не тронуты. Live per-city backtest прогоню после деплоя.