Skip to content
DeepForgeby svx
All problems

Rollout Quality Metric

Problem

Compute a normalized rollout quality score: mean(returns) / optimal_return. An empty rollout or a zero optimal return gives 0.0.

Hint

Normalizing by the optimal return makes scores comparable across tasks.

Test cases

case 1
in: [[5,10],10]
expected: 0.75
case 2
in: [[2],10]
expected: 0.2
case 3
in: [[1],0]
expected: 0
case 4
in: [[],10]
expected: 0
Starter codePython
def rollout_quality_metric(returns, optimal_return):
    # Your code here
    pass

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