Repository navigation
orts 2.4.0: ContextualLogisticBandit, OR-TS over arm-by-cell contrasts - #17
Merged
Merged
Conversation
One logistic fit per batch with a fresh flat intercept per cell, the joint posterior of the arm-by-cell contrasts as the carried state, and a hierarchical prior tying the cells together. Its interaction_sd is re-estimated after each batch by marginal likelihood unless a number is given; no fixed value did well both when the best arm differs by cell and when it does not. With one cell the class reproduces LogisticBandit. Experimental and not in the paper. benchmarks/growthbook/ctxbench.py runs it against GrowthBook's own contextual engine (packages/stats-ts), bundled from source and driven over stdin by gb_contextual_driver.ts. gb_row now takes the arm count from its input so both benchmarks can share it. Co-Authored-By: Claude Fable 5.1 <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.
What
ContextualLogisticBandit(experimental, not in the paper): OR-TS over discrete context cells. One logistic fit per batch with a fresh flat intercept per cell, the joint posterior of the arm-by-cell contrasts as the carried state, and a hierarchical prior tying the cells together.interaction_sd, the prior's one parameter, is re-estimated after each batch by marginal likelihood unless a number is given. No fixed value did well both when the best arm differs by cell and when it does not.LogisticBandit.benchmarks/growthbook/ctxbench.pyruns it against GrowthBook's own contextual engine (packages/stats-ts), bundled from source and driven over stdin bygb_contextual_driver.ts.Benchmark
Cumulative regret, 4 arms, 6 cells, 40 periods of 20,000 users, 20 paired runs.
Tests
11 new tests in
tests/test_contextual.py; 105 pass locally on Python 3.11.🤖 Generated with Claude Code