All problems
Ensemble Prediction Variance
Problem
The disagreement among ensemble members is measured by the population variance of their scalar predictions.
Given the prediction list, return the variance.
Hint
Average the squared deviations from the mean prediction.
Test cases
case 1
in: [[1,2,3]]
expected: 0.6666666666666666
case 2
in: [[0,0]]
expected: 0
case 3
in: [[2,4,6,8]]
expected: 5
Starter codePython
def ensemble_prediction_variance(preds):
# Your code here
pass3 test cases · run your code against them in the editor