1 %> @brief Comparison and p-values tables
4 %> ={[Inf, 0, 0], [1, 2]}
6 dimspec = {[0, 0], [1, 2]};
8 %> =1. Whether to generate the p-values tables
11 %> ={
'rates',
'times3'}
13 %> The first element will be assumed to be the classification rate and used to choose one row
as best
14 names = {
'rates',
'times3'};
19 %> Maximum number of table rows
25 o.classtitle = 'Flat comparison table';
26 o.inputclass = 'sovalues';
31 methods(Access=protected)
32 function out = do_use(o, sov)
34 out.html = ['<h1>', sov.title, '</h1>', 10, o.get_html_tables(sov)];
35 out.title = sov.get_description();
41 %> Generates a table with the best in each architecture, with its respective time and confidence interval
42 %> @param sov sovalues
object
43 function s = get_html_tables(o, sov)
49 if isempty(o.vectorcomp)
51 o.vectorcomp.flag_logtake = 0;
54 [values, ax] = sovalues.get_vv_aa(sov.values, sov.ax, o.dimspec);
56 flag_rejected = isfield(values(1), 'oc') && values(1).oc.flag_rejected;
57 ratess = sovalues.getYY(values, o.names{1});
58 if size(ratess, 2) > 1
59 irerror(
'I cannot handle results that have more than one column!', 2);
62 temp = permute(ratess, [3, 1, 2]);
63 rates = mean(temp, 1);
64 if isfield(values,
'times3')
65 ratessort = rates-std(temp)/1e7-mean(permute(sovalues.getYY(values, 'times3'), [3, 1, 2]), 1)/1e10; % Just to solve ties: if the rate is the same, chooses one with lower standard deviation
67 ratessort = rates-std(temp)/1e7; % Just to solve ties: if the rate is the same, chooses one with lower standard deviation
69 [vv, ii] = sort(ratessort, 'descend'); %
#ok<ASGLU>
71 if isempty(sov.chooser)
74 idxs = sov.chooser.use(values);
77 nnames = numel(o.names);
79 R = permute(squeeze(sovalues.getYY(values, o.names{1})), [2, 1]);
81 ii = o.some_items(nar, choiceidx);
87 Mp = o.vectorcomp.crosstest(R); % Matrix
for the p-values (last column) of the firts table
89 flag_choice = ~isempty(choiceidx);
92 choiceheader = [
'<td class="bob"> </td>', 10];
99 s0 = cat(2, s0,
'<center><table class=bo>', 10,
'<tr>', 10, choiceheader, ...
100 '<td class="bob"><div class="hel">#</div></td>', 10, ...
101 '<td class="bob"><div class="hel">System</div></td>', 10);
104 s0 = cat(2, s0,
'<td class="bob"><div class="hec">', labeldict(o.names{i}),
'</div></td>', 10);
106 % (04/07/2013) Examiners didn
't like this column s0 = cat(2, s0, '<td
class=
"bob"><div
class=
"hec"><em>p</em>-values
', '</div></td>
', 10);
108 s0 = cat(2, s0, '<td
class=
"bob"><div
class=
"hec">Refused (%)</div></td>
', 10);
110 s0 = cat(2, s0, '</tr>
', 10);
114 ni = min(o.maxrows, nar);
116 s0 = cat(2, s0, '<tr>
', 10);
120 flag_chosen = ~isempty(choiceidx) && choiceidx == ii(i);
121 clad = iif(flag_chosen, 'choa
', '');
123 s0 = cat(2, s0, sprintf('<td
class=
"hel%s">
', clad), iif(flag_chosen, '»
', '
'), '</td>
', 10);
126 s0 = cat(2, s0, sprintf('<td
class=
"hel%s">
', clad), int2str(ii(i)), '</td>
', 10);
127 if isfield(values, 'spec
')
128 s0 = cat(2, s0, sprintf('<td
class=
"hel%s">
', clad), values(ii(i)).spec, '</td>
', 10);
130 s0 = cat(2, s0, sprintf('<td
class=
"hel%s">
', clad), 'spec?
', '</td>
', 10);
134 v = values(ii(i)).(o.names{j});
140 civ = std(v); % Let's make standard deviation the standard
for +- specifications
142 s0 = cat(2, s0, sprintf(
'<td class="nu%s">', clad), sprintf(
'%.2f ± %.2f', mv, civ),
'</td>', 10);
146 % (04/07/2013) Examiners didn
't like this column
152 % stemp = iif(x < 0.001, '< 0.001
', sprintf('%.3f
', x));
154 % s0 = cat(2, s0, sprintf('<td
class=
"nu%s">
', clad), stemp, '</td>
', 10);
158 s0 = cat(2, s0, sprintf('<td
class=
"nu%s">%.2f</td>
', clad, 100*mean(values(ii(i)).oc.C(:, 1))), 10);
161 s0 = cat(2, s0, '</tr>
', 10);
163 s0 = cat(2, s0, '</table></center>
', 10);
168 s1 = cat(2, s1, '<h4><em>p</em>-values tables</h4>
', 10, '<p>Vector comparer
object: <b>
', ...
169 o.vectorcomp.get_description(0), ' (<a href=
"matlab:edit(''', class(o.vectorcomp), '.m'')">
', class(o.vectorcomp), '</a>)</b></p>
');
171 R = permute(squeeze(sovalues.getYY(values, o.names{i})), [2, 1]);
173 M = o.vectorcomp.crosstest(R);
175 if ~labeldict(o.names{i}, 1)
178 B = B + (B & M < 0.05)*2;
182 B = B + (B & M > 0.95)*2;
185 M = arrayfun(@(x) iif(x == 0, '-
', iif(x < 0.001, '< 0.001
', sprintf('%.3f
', x))), M, 'UniformOutput
', 0);
187 s1 = cat(2, s1, '<h5><em>p</em>-values
for ', labeldict(o.names{i}), '</h5>
', 10, '<center>
', ...
188 html_comparison(M, arrayfun(@int2str, ii, 'UniformOutput
', 0), B), '</center>
', 10);
193 s = cat(2, s, '<h4>Comparison table</h5>
', 10, s0, 10, s1, 10);
198 %> @return Indexes of some elements
200 %> The number of elements that will figure in the tables is limited by the @c maxrows property. This function returns the indexes of some elements
201 %> around the chosen one (if any was chosen), otherwise returns maxrows elements, starting at the first.
202 function v = some_items(o, nar, choiceidx)
203 if isempty(choiceidx)
208 share2 = 1-A; % percentages of items destinated for the first items and items around choiceidx respectively
210 nit = min(o.maxrows, nar);
212 i1 = floor(choiceidx-share2/2*nit);
213 i2 = ceil(choiceidx+share2/2*nit);
214 i0 = nit-((i2-i1)+1);
Comparison and p-values tables.
Generated by irreport, carries HTML contents.
Paired Vector Comparer base class.
Vector Comparer - paired t-test right tail.
Analysis Session (AS) base class.