diff options
author | Jan Klemkow <j.klemkow@wemelug.de> | 2012-05-10 14:13:45 +0200 |
---|---|---|
committer | Jan Klemkow <j.klemkow@wemelug.de> | 2012-05-10 14:13:45 +0200 |
commit | cdc7ef4b0a7b4581072771540b7807a03879346a (patch) | |
tree | fc0793a69f10f068dc442846f006bc0b02194ae2 | |
parent | 40f24b944ed864f8aebbedead27c46e04fca76cb (diff) | |
download | dmc-cdc7ef4b0a7b4581072771540b7807a03879346a.tar.gz dmc-cdc7ef4b0a7b4581072771540b7807a03879346a.tar.bz2 dmc-cdc7ef4b0a7b4581072771540b7807a03879346a.zip |
calc_error: return quad and total errors.
-rw-r--r-- | calc_error.m | 2 | ||||
-rw-r--r-- | 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); |