All problems
Forecast Bias
Problem
Compute the forecast bias as the mean signed error forecast - actual: (1/n) * sum(forecast[t] - actual[t]).
Return 0.0 for an empty actual list.
Hint
Positive bias means the forecast systematically overshoots.
Test cases
case 1
in: [[10,12,14],[11,11,11]]
expected: -1
case 2
in: [[1,2],[2,1]]
expected: 0
case 3
in: [[5],[7]]
expected: 2
case 4
in: [[1,2,3],[3,3,3]]
expected: 1
Starter codePython
def forecast_bias(actual, forecast):
# Your code here
pass4 test cases · run your code against them in the editor