Repository navigation
Ежемесячные версии скоринга: границы эффекта, плацебо-проверка и исправления по adversarial-проверке - #48
Merged
Conversation
…ersion logs - The default propensity model is now chosen by out-of-fold log-loss between tuned logistic regression and gradient boosting. Logistic regression smooths step-like logging (argmax scoring, mixtures of monthly versions) and assigns probability to offers A never showed those clients: false overlap that the mean-weight check cannot see. On a 6-version monthly panel it reported "caution" with an interval missing the truth; boosting wins the log-loss (0.534 vs 0.616) and the support deficit blocks the decision, as with exact propensities. The choice is pinned for bootstrap replicates; synthetic validation is unchanged (logistic still wins there). - Known logging policy: exact share of the candidate's decisions outside the logs' support in the report, ev.support(), and allowed= for greedy, softmax and epsilon_greedy to evaluate "the new model within what was already shown". - Auto features skip date strings and columns whose values are action labels (other policies' decisions); a candidate column that is also a feature is an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… choice - monthly_versions.ipynb: a new model on monthly-version logs (exact out-of-support share, evaluation within the versions' offers, full evaluation with an exploration slice and how to size the slice). - README: explicit column mapping and the client x month panel format (cluster by id, unbalanced panels, estimand per decision, features as of the decision date, policy-driven attrition). - Methodology and CHANGELOG: propensity model class selection and the false-overlap failure it prevents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New: - Evaluator.bounds: partial-identification bounds for a candidate outside the logs' coverage (sharp bounds against a policy baseline, Imbens-Manski interval with Student quantiles, one-sided "at most / at least", per-action sensitivity and the breakdown lambda searched to saturation). - placebo=: a pre-decision outcome must show no "effect". Weights are centred exactly when the logging policy is known (version mixtures included), the period enters the placebo forecast, materiality is tied to the precision of the estimate, and a pass is reported as a bound. - Version mixtures: rows are checked against their own period's version; coverage findings use the exact uncovered share; the mean weight is compared with its exact expectation (weights_inflated, new weights_deflated); composition shift uses a log-loss-chosen classifier; the seasonality test models client and client-by-period effects (false alarms at 0.001: 0.1-0.2%, versus 35% for one-way ANOVA and 12% for CR1 on rare events); candidates depending on the period are flagged. - random_like(by=...): leave-one-out shares for candidates, realised group shares for the logging role; the same random policy as candidate reuses the logging matrix, also inside mixtures. - Propensity boosting: iterations are the median best early-stopping iteration across folds, L2 penalty so a single rare-action row cannot knock boosting out, the point estimate and the replicates use the same procedure; models are fit single-threaded (multi-threaded boosting was tens of times slower in WSL and hung the tests). - Inference: multivariate-t null for Romano-Wolf and simultaneous intervals, adjusted p never below raw p, simultaneous intervals never narrower than marginal ones (also in bootstrap mode). - Texts name the actual cause of a DR-IPS discrepancy by where the propensities come from (logged, declared policy, decisions outside coverage, period-dependent candidate). Docs and tutorials: methodology, validation (new statistical checks), README and CHANGELOG updated; monthly_versions.ipynb covers the panel format, best version, the scoring effect via bounds and control-group sizing, managers with placebo, a new model, an exploration slice and seasonality; both tutorials re-executed, every result checked against the truth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Зачем
Сценарий «скоринг с ежемесячными версиями» целиком:
Плюс исправления по математическому ревью и трём раундам adversarial-проверки новых возможностей.
Что добавлено
Ложное перекрытие при ступенчатом логировании. Модель пропенсити по умолчанию выбирается по out-of-fold log-loss между логистической регрессией и бустингом. Логистическая регрессия сглаживает argmax скоринга и смеси версий и приписывает вероятность офферам, которые A этим клиентам не показывала. Число итераций бустинга — медиана по фолдам лучшей итерации ранней остановки. Точечная оценка и bootstrap-реплики используют одну и ту же процедуру.
Границы для кандидата вне покрытия логов (
ev.bounds):Так эффект скоринга целиком оценивается сверху без случайного среза.
Плацебо-проверка (
placebo=) на показателе, известном до решения. Она ловит скрытые факторы выбора действия, например менеджеров, которые меняют оффер со знанием клиента.Смесь версий:
1 − доля вне покрытия(weights_inflated, новаяweights_deflated);Туториал
monthly_versions.ipynb— разбор на панели с ручной разметкой:Исправлено по ревью
Все новые возможности прошли три раунда adversarial-проверки: ревьюер искал ошибку, отдельный агент пытался её опровергнуть, и в работу шли только подтверждённые находки. Главное, что исправлено:
alpha;weights_inflated,weights_deflated);compare.1 − α;p_adj ≥ p_raw;Проверено
twine check.docs/validation.md):🤖 Generated with Claude Code