Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-229

Exponential Baseline MSE

Problem

Compute the one-step-ahead MSE of a simple exponential smoothing baseline with factor alpha. Seed the level with the first observation; score each later point against the current level, then update the level.

Return 0.0 for fewer than two points.

Hint

Higher alpha tracks level shifts faster but reacts more to noise.

Test cases

case 1
in: [[1,2,3,4],0.5]
expected: 2.1041666666666665
case 2
in: [[5,5,5],0.3]
expected: 0
case 3
in: [[10],0.5]
expected: 0
case 4
in: [[1,3,5,7],0.8]
expected: 5.303466666666666
Starter codePython
def exponential_baseline_mse(series, alpha):
    # Your code here
    pass

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