diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-09-25 18:48:51 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-09-25 18:48:51 -0400 |
commit | 00223904295fdecd6f3d199bbded4632fd353877 (patch) | |
tree | 01549873436858fed0182500eb023547f18f0da6 | |
parent | afbe6a6bf1e7248aa0bdaf506413d604c974002c (diff) |
bugfix: correctly modify constant coefficient to obtain upper bound
-rwxr-xr-x | csv_tool | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -112,7 +112,7 @@ def numpy_lstsq(x, y): | |||
112 | return lstsq(A, b)[0] | 112 | return lstsq(A, b)[0] |
113 | 113 | ||
114 | def max_delta(c0, c1, x, y): | 114 | def max_delta(c0, c1, x, y): |
115 | return max([abs(c0 + c1 * float(x) - float(y)) for (x,y) in izip(x, y)]) | 115 | return max([float(y) - (c0 + c1 * float(x)) for (x,y) in izip(x, y)]) |
116 | 116 | ||
117 | def least_squares(rows, xy_pairs, upper_bound): | 117 | def least_squares(rows, xy_pairs, upper_bound): |
118 | cols = [] | 118 | cols = [] |