Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-233

Bias-Variance Decomposition

Problem

Return the expected squared error at a point from its information decomposition:

E[(y - f_hat)^2] = bias^2 + variance + noise

where noise is the irreducible error of the data-generating process.

Hint

Only the bias and variance terms are under the modeler's control.

Test cases

case 1
in: [1,1,1]
expected: 3
case 2
in: [0,0,0]
expected: 0
case 3
in: [0.5,0.25,0.25]
expected: 0.75
case 4
in: [2,3,0]
expected: 7
Starter codePython
def bias_variance_decomposition(bias, variance, noise):
    # Your code here
    pass

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