Skip to content
DeepForgeby svx
All problems

Dataset Return Distribution Stats

Problem

Summarize a dataset of episode returns.

Return [mean, population_std, min, max] using division by n for the standard deviation. An empty dataset returns four zeros.

Hint

Distribution stats tell you how much the offline dataset explores high-return behavior.

Test cases

case 1
in: [[1,2,3,4]]
expected: [2.5,1.118033988749895,1,4]
case 2
in: [[5]]
expected: [5,0,5,5]
case 3
in: [[]]
expected: [0,0,0,0]
case 4
in: [[-1,0,1]]
expected: [0,0.816496580927726,-1,1]
Starter codePython
import math
def return_distribution_stats(returns):
    # Your code here
    pass

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