summaryrefslogtreecommitdiff
path: root/calc_error.m
blob: 7ed3a5ebc97b62d69cb0b9c37661b2b6b7b00726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function calc_error(name, data, pred)

	quad = quad_error(data, pred);
	total = total_error(data, pred);

	printf('%9s quad:  %9d\n', name, quad);
	printf('%9s total: %9d\n', name, total);

	xlabel('products');
	ylabel('total error');
	plot((sum(abs(data - pred))), '-ob;unsorted;');
	hold on;
	plot(sort(sum(abs(data - pred))), '-or;sorted;');
	hold off;
end