All problems
Cross-Learning Sample Count
Problem
Count training windows when multiple series are pooled for cross-learning: n_series * ((length - window) // stride + 1).
Return 0 when window or stride is not positive, or when length is shorter than the window. Pooling lets sporadic series borrow strength from each other.
Hint
Global models see the union of all series' windows during training.
Test cases
case 1
in: [10,100,24,1]
expected: 770
case 2
in: [3,50,10,5]
expected: 27
case 3
in: [5,10,10,1]
expected: 5
case 4
in: [2,10,11,1]
expected: 0
Starter codePython
def cross_learning_sample_count(n_series, length, window, stride):
# Your code here
pass4 test cases · run your code against them in the editor