A contextual bandit chooses among available actions using observed context, then uses the resulting feedback to pursue a reward. In recommendation systems, an agent consumes a user’s recent history and selects an ad banner, while optimizing measures such as click-through rate, conversion rate, or eCPM. Because shown ads influence later behavior, the decision process has a feedback loop. section 12.1.3
A practical contextual-bandit setup includes:
- User context, such as recent history. section 12.1.3
- Available items or ads, treated as alternative actions. section 12.1.3
- Observed feedback, which may be binary or continuous. section 12.1.3
- Historical replay for simulating recommendations and evaluating policies offline. section 12.1.3
Figure 12.1 Unbiased estimator (offline validation): stream of real events
Use the event-stream figure to contrast real recommendation events with their offline validation setting. section 12.1.3


