Repository navigation
Основной сценарий на реальных данных: auto-оценщик, интервалы V, согласие оценщиков, подбор C пропенсити - #45
Merged
Merged
Conversation
- Binary logistic regressions on designs up to 300 columns use the newton-cholesky solver: 4-5x faster than lbfgs on Hillstrom and closer to the optimum (lbfgs at default tolerance stops early). Validation results are unchanged to the fourth significant digit. - Predictions are built one action at a time instead of stacking k copies of the design (6 GB on 50k OBD rows with 34 actions). - The x*a interaction block is dropped only when the design would exceed 3e7 cells; the decision is made once on the full sample and pinned for bootstrap replicates. Choosing the design by out-of-fold error was tried and rejected: it does not see errors in action contrasts and on Hillstrom removed the heterogeneity DM needs (-0.05 vs -1.33 pp). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- estimator="auto" (default) picks the primary estimator from whether propensities are logged (DR in both cases today) and the report says why; selection by the narrowest interval is deliberately not used. - The main table and summary() show V(A) and V(B) with intervals next to delta; compare() shows them too. - Each metric gets an agreement verdict from the DR-IPS and DR-DM checks (agree / disagree / unclear) and the spread of delta across all five estimators in units of the primary SE. - The headline names the findings behind a caution/unreliable verdict. - New info finding outcome_without_interactions when x*a is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-loss On the Open Bandit Dataset (uniform logging, 34 actions, 66 mostly sparse features) LogisticRegression with C=1 overfit: estimated propensities ranged 0..0.98 instead of 1/34 and DR put V(BTS) at 0.51% against a truth of 0.67%. C is now chosen on the full sample by OOF log-loss over 10..1e-6, walking from weak to strong regularization and stopping after two consecutive increases (the strong-regularization end is a flat plateau whose noise would stop a walk from that side too early). With C=1e-5 DR gives 0.70%, the same as with logged propensities. The chosen C is pinned for bootstrap replicates and the tuning time is excluded from the bootstrap ETA. Custom propensity models are used as given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The ETA assumed a 4x speedup on 8 cores; real runs on Hillstrom and the Open Bandit Dataset show about 2x (replicates compete for memory bandwidth and core frequency), so OBD was promised 10 minutes and took 28. The speedup is now jobs/4. - Trust reasons lowercased the first letter of every finding title, turning "IPS и DR расходятся" into "iPS ...". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- examples/real_data.py downloads Hillstrom (randomized e-mail campaign) and the Open Bandit Dataset and runs the main scenario against an independent truth: logs without propensities, two policies, automatic estimator, intervals for V(A), V(B) and delta, trust and agreement. - docs/real_data.md: Hillstrom over 10 splits (all delta intervals cover the truth; visit "worse" 10/10, estimators agree in 20/20) and OBD (without propensities BTS is "better", V(BTS) 0.70% [0.58; 0.81] against a truth of 0.674%, same as with logged propensities), plus the library changes these checks led to. - README: main scenario section, auto estimator, value intervals and agreement verdict, realistic timings. Methodology: estimator choice, outcome design rule, propensity C tuning, agreement verdict, new finding code. Tutorial section 5 is now the main scenario, compared with the analytic truth, and re-executed. 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.
Зачем
Проверить основной сценарий на открытых реальных данных с известной истиной и доработать библиотеку там, где он оказался не готов. Сценарий:
Что показала проверка (
docs/real_data.md)Hillstrom — рандомизированная email-рассылка, 64 тыс. клиентов, 3 действия. Логи прод-политики без пропенсити строятся отбором с отказом, истина — IPS на отложенной рандомизированной половине.
Open Bandit Dataset (ZOZOTOWN), 34 товара. A — случайная политика, пропенсити из логов убраны; B — Thompson Sampling, истина — её CTR в параллельном A/B-тесте (4 млн показов).
Что изменено в библиотеке
estimator="auto"по умолчанию. Основной оценщик выбирается по тому, залогированы ли пропенсити (сейчас это DR), и отчёт объясняет выбор. Выбора по самому узкому интервалу намеренно нет.summary()иcompare().outcome_without_interactions.examples/real_data.pyвоспроизводит проверку и сам скачивает данные. Раздел 5 туториала — основной сценарий в сравнении с истиной.Отвергнутая идея — выбирать дизайн модели исхода по out-of-fold ошибке: на Hillstrom DM потерял весь эффект. Описано в
docs/methodology.md.Проверено локально
validate.py --runs 30 --clients 2000 --n-boot 60 --strict: результаты совпали с прежними до 3–4 знака.buildиtwine check --strict.🤖 Generated with Claude Code