An action is a candidate decision available to a contextual bandit. In a post-display system, displaying one particular post is an action; the selected action depends on the user context and produces a measurable reward such as viewing time. section 5.1.1
Choosing a post
When a user opens the app, the system chooses one post from many possible posts. Different user features can lead the system to choose different actions, while viewing time measures the outcome of that choice. section 5.1.1
Listing 5.2 A logged sample
class Sample:
def __init__(self, context, action, reward):
self.context = context #1
self.action = action #2
self.reward = reward #3
Inspect the logged sample structure, which records the context, selected action, and resulting reward for later modeling. section 5.1.1












