Two rankers, one test
An A/B test splits traffic: some users see ranker A, some see B, and you compare bookings. The first decision is the unit you randomize. A prep site lists a Netflix data science question built around that choice: user-level, session-level or query-level randomization (1 source).
| One user's five searches | Units | Spill-over | |
|---|---|---|---|
| query-level | A B B A B | most | A can change how they use B |
| user-level | A A A A A | fewer | none |
Query-level gives the most units, but one person sees both rankers, and their behavior on one can spill into the other. User-level keeps each person on one ranker, at the cost of fewer units. Whatever you randomize, compute the standard errors at that unit.
The editor holds arm(unit_id), a stable coin flip: it hashes the id, so the same id always lands in the same arm. Write assign(searches, unit), which flips that coin on the user id or on the query id, and n_units(searches, unit), the number of independent units. searches holds one (user, query id) pair per search: two users with five searches each.