gendesign/tradein-mvp/backend/tests/fixtures/backtest_baseline.json
bot-backend f7d0bbd30e
All checks were successful
CI / changes (pull_request) Successful in 7s
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
feat(tradein/backtest): frozen fixture + baseline + hermetic CI regression gate (#1966 PR 3/3)
Commits the gzipped 277-deal prod fixture (frozen _price_from_inputs inputs),
the frozen backtest_baseline.json (overall MAPE 18.63% / bias -1.2%; per-segment
бизнес -21.5% / элит -38.6% — the systemic expensive-segment underestimation,
now measured), and a hermetic pytest gate that replays the fixture through the
full pricing spine (ZERO DB) and asserts metrics == baseline within float tolerance.

Relative regression gate, not an absolute SLA (live coverage ~55% is data-blocked
per #1966). To change estimator behaviour: regenerate the baseline
(--from-fixture --update-baseline, no DB) and justify the per-segment deltas in the PR.
The fixture (gzipped prod inputs) re-extracts rarely; the per-change artifact is the
3 KB baseline. Large-file hook excludes the fixture (re-extracted only on ground-truth refresh).

Refs #1966
2026-06-27 15:49:58 +03:00

154 lines
3.1 KiB
JSON

{
"calibration": {
"high": {
"coverage_pct": null,
"mape_pct": null,
"n": 0,
"n_covered": 0
},
"low": {
"coverage_pct": 55.27,
"mape_pct": 18.63,
"n": 275,
"n_covered": 152
},
"medium": {
"coverage_pct": 50.0,
"mape_pct": 19.18,
"n": 2,
"n_covered": 1
}
},
"confidence_order": [
"high",
"medium",
"low"
],
"expected_sold": {
"overall": {
"mape_pct": 18.63,
"median_bias_pct": -1.2,
"n": 277,
"n_no_analogs": 0,
"p25_pct": -16.25,
"p75_pct": 20.26
},
"per_rooms": {
"0": {
"label": "студия",
"mape_pct": 27.97,
"median_bias_pct": 27.56,
"n": 37,
"n_no_analogs": 0,
"p25_pct": -8.97,
"p75_pct": 38.45
},
"1": {
"label": "1к",
"mape_pct": 19.55,
"median_bias_pct": -8.08,
"n": 93,
"n_no_analogs": 0,
"p25_pct": -21.27,
"p75_pct": 13.3
},
"2": {
"label": "2к",
"mape_pct": 16.22,
"median_bias_pct": -8.82,
"n": 74,
"n_no_analogs": 0,
"p25_pct": -21.01,
"p75_pct": 6.13
},
"3": {
"label": "3к",
"mape_pct": 10.52,
"median_bias_pct": 4.08,
"n": 43,
"n_no_analogs": 0,
"p25_pct": -6.54,
"p75_pct": 11.96
},
"4": {
"label": "4+",
"mape_pct": 23.53,
"median_bias_pct": 14.35,
"n": 30,
"n_no_analogs": 0,
"p25_pct": -0.72,
"p75_pct": 35.27
}
},
"per_segment": {
"бизнес": {
"mape_pct": 22.14,
"median_bias_pct": -21.49,
"n": 46,
"p25_pct": -28.22,
"p75_pct": -9.82
},
"комфорт": {
"mape_pct": 16.74,
"median_bias_pct": -8.05,
"n": 104,
"p25_pct": -20.63,
"p75_pct": 7.55
},
"премиум": {
"mape_pct": 59.37,
"median_bias_pct": -59.37,
"n": 1,
"p25_pct": -59.37,
"p75_pct": -59.37
},
"эконом": {
"mape_pct": 18.01,
"median_bias_pct": 17.17,
"n": 120,
"p25_pct": 1.73,
"p75_pct": 46.96
},
"элит": {
"mape_pct": 38.62,
"median_bias_pct": -38.62,
"n": 6,
"p25_pct": -47.98,
"p75_pct": -33.18
}
}
},
"headline": {
"ask_median_ppm2": 147545.8502510892,
"deal_median_ppm2": 125063.0,
"spread_pct": 17.98
},
"range_coverage": {
"overall": {
"coverage_pct": 55.23,
"n": 277,
"n_covered": 153
},
"per_confidence": {
"high": {
"coverage_pct": null,
"n": 0,
"n_covered": 0
},
"low": {
"coverage_pct": 55.27,
"n": 275,
"n_covered": 152
},
"medium": {
"coverage_pct": 50.0,
"n": 2,
"n_covered": 1
}
}
},
"sharpness": {
"median_rel_width": 0.4638,
"n": 277
}
}