concept contextual bandit in category deep learning
appears as: contextual bandit, contextual bdits, contextual bdit, contextual bdit

This is an excerpt from Manning's book Deep Reinforcement Learning in Action.
Figure 2.5. Overview of a contextual bandit for advertisement placement. The agent (which is a neural network algorithm) receives state information (in this case, the current website the user is on), which it uses to choose which of several advertisements it should place at the checkout step. Users will click on the advertisement or not, resulting in reward signals that get relayed back to the agent for learning.
![]()
We’ve built a simulated environment for a contextual bandit. The simulator includes the state (a number from 0 to 9 representing 1 of the 10 websites in the network), reward generation (ad clicks), and a method that chooses an action (which of 10 ads to serve). The following listing shows the code for the contextual bandit environment, but don’t spend much time thinking about it as we want to demonstrate how to use it, not how to code it.