All problems
Known Future Covariate Use
Problem
Apply known future covariates as a dot product: sum(value * weight).
These covariates, such as planned promotions or calendar effects, are known ahead of the forecast origin.
Hint
Known-future inputs shift the forecast before any observation arrives.
Test cases
case 1
in: [[1,2,3],[0.5,0.5,0.5]]
expected: 3
case 2
in: [[0,0],[1,2]]
expected: 0
case 3
in: [[5],[2]]
expected: 10
case 4
in: [[],[]]
expected: 0
Starter codePython
def known_future_covariate_use(future_values, weights):
# Your code here
pass4 test cases · run your code against them in the editor