Skip to content
DeepForgeby svx
All problems

Bayesian Regret Lite

Problem

Compute the cumulative pseudo-regret of a bandit algorithm.

For each arm add counts[a] * (max(means) - means[a]), the expected loss from pulling suboptimal arms. Return the total.

Hint

Only pulls of suboptimal arms contribute to regret.

Test cases

case 1
in: [[0.2,0.5],[10,5]]
expected: 3
case 2
in: [[0.1,0.4,0.6],[3,4,5]]
expected: 2.3
case 3
in: [[1],[7]]
expected: 0
Starter codePython
def bayesian_regret_lite(means, counts):
    # Your code here
    pass

3 test cases · run your code against them in the editor