Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Delayed reward computation

slivkins edited this page Sep 6, 2016 · 10 revisions

It is possible to delay reward computation to a later stage in the Decision Service. The outcome of an experimental unit can consist of multiple "fragments", and the reward can be computed from these fragments by the Join Service.

Outcomes can be logged using ReportOutcome. The only constraint for the string is to be valid JSON. For example,

ReportOutcome("{\"myReward\" = 1, \"otherInformation\" = \"tablet user\"}", "<eventId>") 

ReportOutcome can be called multiple times for the same experimental unit, but only the last call will be used by the Join Service.

To compute the reward in the Join Service, modify the Azure Stream Analytics join query in your Decision Service deployment. Look for -observation.v and following the above example you can change it to -observation.v.myReward. Whatever outcome you log, you'll have to be able to convert to a single float at this point. As Azure Stream Analytics SQL is declarative not all reward functions will be expressable, you can integrate with AzureML (see AzureML/ASA Integration).

Clone this wiki locally