All problems
Disagreement Bonus
Problem
Compute an ensemble disagreement bonus as the range of the ensemble predictions: max(predictions) - min(predictions). An empty ensemble returns 0.0.
Hint
Where ensemble members disagree, the agent is uncertain and exploration pays off.
Test cases
case 1
in: [[1,2,3]]
expected: 2
case 2
in: [[5,5]]
expected: 0
case 3
in: [[]]
expected: 0
case 4
in: [[-1,1]]
expected: 2
Starter codePython
def disagreement_bonus(predictions):
# Your code here
pass4 test cases · run your code against them in the editor