fix(estimator): DKP corridor uses P10/P90 not min/max (#1520) #1695

Merged
lekss361 merged 1 commit from fix/dkp-corridor-percentile-1520 into main 2026-06-17 18:05:41 +00:00
Owner

Проблема (#1520, LOW)

estimator.py _fetch_dkp_corridor: low/high_ppm2 = ppm2_values[0]/[-1] — чистые min/max выборки (выбросы) в soft-bound коридоре.

Решение

_percentile(values, 0.10) / 0.90 с линейной интерполяцией. Малая выборка: n=2 коридор сужается ~10% внутрь, n=1 P10=P90=median; гард caller'а count>=3 уже подавляет soft-bound label для крошечных выборок.

Verify

n=3 [100k,120k,140k]: low 100k→104k, high 140k→136k. ruff clean, py_compile ok; pytest207 passed (2 теста обновлены).

Closes #1520

## Проблема (#1520, LOW) `estimator.py` `_fetch_dkp_corridor`: `low/high_ppm2 = ppm2_values[0]/[-1]` — чистые min/max выборки (выбросы) в soft-bound коридоре. ## Решение `_percentile(values, 0.10)` / `0.90` с линейной интерполяцией. Малая выборка: n=2 коридор сужается ~10% внутрь, n=1 P10=P90=median; гард caller'а `count>=3` уже подавляет soft-bound label для крошечных выборок. ## Verify n=3 [100k,120k,140k]: low 100k→104k, high 140k→136k. `ruff` clean, `py_compile` ok; `pytest` → **207 passed** (2 теста обновлены). Closes #1520
lekss361 added 1 commit 2026-06-17 17:56:57 +00:00
fix(estimator): DKP corridor uses P10/P90 not min/max (#1520)
All checks were successful
CI / changes (push) Successful in 8s
CI / changes (pull_request) Successful in 7s
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
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
6eda4a6d0a
Replace absolute min/max with robust percentiles so a single outlier ДКП
deal cannot shift the soft-bound corridor boundaries. Small samples fall
back gracefully via linear interpolation (n=3: P10≈index 0.2, P90≈index 2.8).
lekss361 merged commit 262adbf762 into main 2026-06-17 18:05:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1695
No description provided.