All problems
Holiday Effect Multiplier
Problem
Compute the multiplicative holiday adjustment applied to a baseline forecast: 1 + holiday_effect / baseline, where holiday_effect is the absolute lift or drag.
Return 1.0 when the baseline is zero.
Hint
A negative effect produces a multiplier below 1, shrinking the baseline.
Test cases
case 1
in: [100,20]
expected: 1.2
case 2
in: [50,-10]
expected: 0.8
case 3
in: [0,5]
expected: 1
case 4
in: [200,0]
expected: 1
Starter codePython
def holiday_effect_multiplier(baseline, holiday_effect):
# Your code here
pass4 test cases · run your code against them in the editor