From cdc7ef4b0a7b4581072771540b7807a03879346a Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Thu, 10 May 2012 14:13:45 +0200 Subject: calc_error: return quad and total errors. --- calc_error.m | 2 +- run_tests.m | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/calc_error.m b/calc_error.m index 0538678..a26b714 100644 --- a/calc_error.m +++ b/calc_error.m @@ -1,4 +1,4 @@ -function calc_error(name, data, pred) +function [quad, total] = calc_error(name, data, pred) quad = quad_error(data, pred); total = total_error(data, pred); diff --git a/run_tests.m b/run_tests.m index 5d06086..065e1e2 100644 --- a/run_tests.m +++ b/run_tests.m @@ -14,13 +14,13 @@ sevenday_data = repmat(sevenday_pred(train_data, 4), 2, 1); random_data = rand_pred(train_data, 14); % plot prediction quallity -calc_error('mean', real_data, mean_data); -calc_error('regress', real_data, regress_data); +[meqerr, meterr] = calc_error('mean', real_data, mean_data); +[reqerr, reterr] = calc_error('regress', real_data, regress_data); % quadratic just for reference, it sucks more than mean-predicition -calc_error('quad reg.', real_data, quad_data); -calc_error('log reg.', real_data, log_data); -calc_error('sevenday', real_data, sevenday_data); -calc_error('random', real_data, random_data); +[quqerr, quterr] = calc_error('quad reg.',real_data, quad_data); +[loqerr, loterr] = calc_error('log reg.', real_data, log_data); +[seqerr, seterr] = calc_error('sevenday', real_data, sevenday_data); +[raqerr, raterr] = calc_error('random', real_data, random_data); [q2, removed] = remove_sevenday_frequency(q(1:14, :)); tmp = regress_pred(p([1:14 29:42],:), q2); -- cgit