summaryrefslogtreecommitdiff
path: root/calc_error.m
diff options
context:
space:
mode:
Diffstat (limited to 'calc_error.m')
-rw-r--r--calc_error.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/calc_error.m b/calc_error.m
index bedee9e..90b3dd9 100644
--- a/calc_error.m
+++ b/calc_error.m
@@ -1,5 +1,8 @@
function [quad, total, local] = calc_error(name, data, pred)
+ quad_error = @(a, b) sqrt(sum(sum((a - b) .^ 2)));
+ total_error = @(a, b) sum(sum(abs(a - b)));
+
quad = quad_error(data, round(pred));
total = total_error(data, round(pred));
local = sum(abs(data - round(pred)));