blob: 7fcf0e1bd82872ae808bd2fb1ae8d226c7480d53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
function calc_error(name, data, pred)
quad = quad_error(data, pred);
total = total_error(data, pred);
printf('%10s 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
|