Repository navigation
Случайные политики, известная логирующая политика, смесь версий модели и честный выбор лучшего - #47
Merged
Merged
Conversation
Policies
- ps.uniform(), ps.random_like(source, by=...) and ps.mixture(...):
random assignment with the observed (or any policy's) mix of actions,
overall or within groups such as months, and mixtures of policies.
Logging policy instead of a propensity column
- logging_policy= computes propensities exactly from a known rule A;
a deterministic A is blocked as before.
- Several loggers (logging_policy={label: policy}, logger=): balanced
IPS mixture propensities (Agarwal et al., 2017), so even deterministic
model versions used in different months provide exploration where
they disagree. New findings check the assumption: logger_shift (period
predictable from client features) and logger_drift (response differs
across periods on rows where all versions choose the same action).
Competition
- compare() adds simultaneous intervals for every candidate's delta,
pairwise differences with simultaneous intervals and Romano-Wolf
p-values, and Leaderboard.best(metric, guardrails): leader, the set of
candidates not significantly beaten (contains the true best w.p. at
least 1 - alpha), and non-inferiority guardrails on other metrics.
- Slow tests: simultaneous coverage 0.935 vs 0.84 marginal, true best in
the set 0.995 (200 runs); two deterministic loggers: bias -0.001,
coverage 0.97 (100 runs).
Simulator: OfferSimulator.versions() for regularly retrained models and
simulate(shift=) for seasonal response.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tutorial.ipynb: comparison with random assignment (overall and with the candidate's mix), a competition of three different targeting models with board.best and guardrails, logs of several model versions, and why randomness is needed in the logs rather than in the evaluated policy (including human "wrapping" of model recommendations). - monthly_versions.ipynb: a separate end-to-end pipeline for a scoring model retrained monthly: best version on all clients (intervals about half as wide as naive per-month means), why random assignment cannot be evaluated without an exploration slice and how a 10% slice fixes it, and seasonality detection. Executed in CI. - README, methodology (estimator selection by competition, logging policies and mixtures, new finding codes, assumptions), CHANGELOG. 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.
Зачем
Два сценария, которые раньше не поддерживались:
Что добавлено
Политики
ps.uniform()— равномерная случайная выдача.ps.random_like(source, by=...)— случайная выдача с балансом действий наблюдаемой политики или любой другой. Параметрbyсохраняет баланс внутри групп, например по месяцам.ps.mixture(...)— смесь политик.Логи без пропенсити, но с известной политикой
logging_policy=вместо колонки пропенсити: пропенсити считаются точно. Детерминированная A честно блокируется.logging_policy={метка: политика},logger=. Пропенсити — смесь версий (balanced IPS, Agarwal et al., 2017), так что даже детерминированные версии вместе дают исследование. Предпосылка проверяется находками:logger_shift— состав клиентов в периодах;logger_drift— сезонность отклика на клиентах, которым все версии рекомендуют одно и то же.Соревнование кандидатов (
compare,Leaderboard.best)board.pairwise).Туториалы
examples/tutorial.ipynb— новые разделы: сравнение со случайной политикой, соревнование трёх разных моделей, логи нескольких версий. Добавлено объяснение, почему случайность нужна в логах, а не в оцениваемой политике, и как быть с «обвязкой» из менеджеров.examples/monthly_versions.ipynb— отдельный разбор для ежемесячных версий:Проверено
🤖 Generated with Claude Code