Skip to content
DeepForgeby svx
All problems
MediumTime Seriests-161

Rolling-Origin Evaluation Count

Problem

Count the number of rolling-origin forecasts: n - initial - horizon + 1 when positive, otherwise 0.

Each origin trains on a fixed window and forecasts horizon steps ahead.

Hint

Origins run from the initial window up to the point that still allows a full horizon.

Test cases

case 1
in: [100,60,1]
expected: 40
case 2
in: [100,90,5]
expected: 6
case 3
in: [10,10,1]
expected: 0
case 4
in: [5,3,1]
expected: 2
Starter codePython
def rolling_origin_count(n, initial, horizon):
    # Your code here
    pass

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