summaryrefslogtreecommitdiff
path: root/calc_error.m
blob: 7204715a71849e3d3d4b29d65e8644659ad8c71a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function [quad, total] = calc_error(name, data, pred)

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

	printf('%-11s quad: %d\t total: %d\n', name, quad, total);

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