Viewing time measures how long a user takes to close the application after seeing a displayed post. It serves as the system’s business-metric outcome: the model predicts viewing time from a user and a post, while the recommender chooses which post to display. section 5.1.1
A simulated engagement signal
A small simulator returns a positive, noisy value whose mean depends on the user context and the selected post’s action weights: measure_viewing_time(context, action_weights) = exp((context * action_weights).mean() + 0.1 * noise). Each observation can then be logged as context, action, and reward. section 5.1.1
In a contextual-bandit recommender, the user is the context, displaying a post is the action, and viewing time is the reward. A greedy policy estimates viewing time for every available post and displays the one with the highest prediction; models are refit daily from logged observations. section 5.1.1 section 5.1.2
Use viewing time with these operational checks:
- Evaluate a daily recommender with mean viewing time per post when the model is refit once per day. section 5.1.3
- Treat viewing time as appropriate for contextual bandits only when one display causes the measured reward; sequences of dependent actions require a multistep return. section 5.1.3
- Handle cold starts with a manually designed policy or initialized model parameters so the system can begin collecting logs. section 5.1.2
Listing 5.1 Simulate viewing time
def measure_viewing_time(context, action_weights):
return np.exp( (context*action_weights).mean() #1
+ 0.1*np.random.normal()) #2
Inspect the simulator that generates positive, noisy viewing-time outcomes from context and action weights. section 5.1.1
