Skip to content
DeepForgeby svx
All problems
HardTime Seriests-219

Encompassing Test

Problem

Run a lite forecast encompassing check: compare mean squared errors and return True when errors1 has the smaller MSE, meaning forecast 1 encompasses forecast 2.

Return False for empty inputs or when the MSEs tie.

Hint

Encompassing means the other forecast adds no information beyond this one.

Test cases

case 1
in: [[1,1],[2,2]]
expected: true
case 2
in: [[2,2],[1,1]]
expected: false
case 3
in: [[1,2],[1,2]]
expected: false
case 4
in: [[],[1]]
expected: false
Starter codePython
def encompassing_test(errors1, errors2):
    # Your code here
    pass

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