1 %>@ingroup
string htmlgen
3 %>@brief Transforms matrix into HTML
7 %> @param CC confusion matrix (first column always represents
"rejected" items)
8 %> @param rowlabels row labels
9 %> @param collabels=rowlabels column labels
11 %> @param flag_rejected=(
auto-detect)
12 %> @param flag_color=1 Whether to use colors
for cell background. If
true, will paint the background with a red gradient which is
13 %> @param SS Standard deviations (optional)
14 %> proportional to the square root of the number inside divided by the square root of the corresponding row sum.
16 function s =
html_confusion(CC, rowlabels, collabels, flag_perc, flag_rejected, flag_color, SS)
18 if ~exist('collabels', 'var') || isempty(collabels)
19 collabels = rowlabels;
22 if ~exist('flag_perc', 'var') || isempty(flag_perc)
28 if ~exist('flag_rejected', 'var') || isempty(flag_rejected)
29 flag_rejected = any(CC(:, 1) > 0);
32 if ~exist('flag_color', 'var') || isempty(flag_color)
37 if ~exist('SS', 'var')
40 flag_std = ~isempty(SS);
45 CC = round(CC*100)/100; % To make 2 decimal places only
48 SS = round(SS*100)/100;
55 if flag_rejected; c = [c,
'rejected']; end;
57 h = arrayfun(@(s) [
'<td class="tdhe">', s{1},
'</td>'], c,
'UniformOutput', 0);
58 s = [
'<table>', 10,
'<tr>', strcat(h{:}),
'</tr>', 10];
68 k = 0; % graphics column (whereas j is the matrix column)
69 for j =
iif(flag_rejected || ni == nj, 1, 2):nj % column loop
80 sfrag = [
'±', num2str(SS(i, j)), sperc];
85 h{k} = [
'<td class="tdnu" style="color: #', fgcolor,
'; background-color: #', bgcolor,
';">', num2str(n), sperc, ...
89 s = cat(2, s, [
'<tr><td class="tdle">', rowlabels{i},
'</td>', strcat(h{:}),
'</tr>', 10]);
91 s = cat(2, s,
'</table>', 10);
function html_comparison_std(in M, in S, in labels, in B, in cornerstr)
function html_confusion(in CC, in rowlabels, in collabels, in flag_perc, in flag_rejected, in flag_color, in SS)
function html_table_std(in M, in S, in rowlabels, in collabels, in B, in cornerstr)
function html_comparison(in M, in labels, in B, in cornerstr)
function html_table_std_colors(in M, in S, in rowlabels, in collabels, in cornerstr, in minimum, in maximum, in pow)
function cellcolor(in n, in ma, in flag_hex)
function iif(in cond, in x1, in x2)