<xi, di>
di = f(xi) + err
x, d, h(x) = x mod 9, h(x) = x/3, h(x) = 2,
1, 1, 1%9 = 1, 1/3, 2,
3, 0, 3%9 = 3, 1, 2,
6, 5, 6%9 = 6, 2, 2,
10, 2, 10%9= 1, 10/3, 2,
11, 1, 11%9= 2, 11/3, 2,
13, 4, 13%9 = 4, 13/3, 2,
sum of squared errors for each (excel calc)
h(x) = x mod 9
sum of squared errors = 12
h(x) = x/3
sum of squared errors = 19.44
h(x) = 2
sum of squared errors = 19
Use the smallest
Or better way: write a python script
sum of squared errors = 19
Use the smallest
Or better way: write a python script
No comments:
Post a Comment