Contextual Bandit Offline Evaluation (Linear Greedy Policy, IPS, SNIPS, Doubly Robust, LinUCB Replay)
A contextual bandit chooses an action for each user based on what is known about that user and learns from the rewards that follow. Offline evaluation estimates, from logs of past decisions, how much reward a new context-based policy would have earned without deploying it.
맥락 밴딧은 사용자에 대해 알려진 정보를 보고 사용자마다 행동을 고르고, 그 뒤의 보상으로 배우는 방식입니다. 오프라인 평가는 과거 결정 기록만으로 새 정책을 실제로 배포하지 않고도 얼마나 보상을 얻었을지 추정합니다.
Would a policy that picks the arm predicted to work best for each context have earned more than the policy that generated our logs, and by how much?
맥락마다 가장 좋을 것으로 예측되는 선택지를 고르는 정책이 지금 기록을 만든 정책보다 보상을 더 얻었을까요, 얼마나 더 얻었을까요?
A linear reward model is fitted for each arm with cross-fitting, and the policy that picks the arm with the highest predicted reward is valued out of fold with inverse propensity weighting, its self-normalised version and the doubly robust estimator, each with a confidence interval. The same is done for always choosing a single arm, and the improvement over the logging policy is tested. When the logs come from uniformly random choices, the LinUCB algorithm is also replayed over the log.
When to use Contextual Bandit Offline Evaluation (Linear Greedy Policy, IPS, SNIPS, Doubly Robust, LinUCB Replay)
- You have logs of contexts, the arm chosen and the reward, ideally with the probability with which the arm was chosen
- You want to know whether personalising the choice by context beats the current policy before running a live test
- You want to compare a learned policy with always-one-arm policies
When to use something else
- Arms do not depend on context and you want to simulate or replay classic bandit algorithms: use Multi-Armed Bandit Simulation and Replay (epsilon-Greedy, UCB1, Thompson, EXP3)
- You want an interpretable treatment rule for a binary treatment: use Policy Learning (Optimal Treatment Rule)
- You only need the average effect of one treatment versus control: use Augmented Inverse Probability Weighting (Doubly Robust)
Assumptions and requirements
- Every arm had a positive probability of being chosen in every context (overlap)
- Logged propensities are correct, or the propensity or reward model is correctly specified
- Rewards of one decision do not depend on other decisions
- Replay requires that the logging policy chose arms uniformly at random
What the analysis reports
- Estimated value of the learned policy by IPS, SNIPS and DR with confidence intervals
- Values of always-one-arm policies and of the logging policy
- Improvement over the logging policy with confidence interval and p-value
- Effective sample size, match rate and propensity clipping
- LinUCB replay value when applicable
How to report it
In [value] logged decisions over [value] arms, the learned linear policy had a doubly robust value of [value] (95% CI [value] to [value]) versus [value] for the logging policy, an improvement of [value] (95% CI [value] to [value], p = [value]).
Related methods
- Multi-Armed Bandit Simulation and Replay (epsilon-Greedy, UCB1, Thompson, EXP3)
- Policy Learning (Optimal Treatment Rule)
- Augmented Inverse Probability Weighting (Doubly Robust)
- Inverse Probability Weighting (IPW)
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with scikit-learn and direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-8.
독립 계산. scikit-learn·직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-8).
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Contextual Bandit Offline Evaluation (Linear Greedy Policy, IPS, SNIPS, Doubly Robust, LinUCB Replay) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable, a treatment indicator and predictor (feature) columns
- Price
- 600 credits for one analysis up to 10,000 rows (complexity level 4); larger or wider data costs more. Optional methodologist review: 2400 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.