IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
report_testtable.m
Go to the documentation of this file.
1 % @brief Test table using FSG and single variable.
3  properties
4  idx_fea = 1;
5  %> =def_fsg(). A FSG object
7  end;
8 
9  methods
10  function o = report_testtable()
11  o.classtitle = 'Test table';
12  o.inputclass = 'irdata';
13  o.flag_params = 1;
14  end;
15  end;
16 
17  methods(Access=protected)
18  function out = do_use(o, data)
19  out = log_html();
20  out.html = o.get_html_table(data);
21  out.title = ['Test table', data.get_description()];
22  end;
23  end;
24 
25  methods
26  function s = get_html_table(o, data)
27  f = def_fsg_testtable(o.fsg);
28  f.flag_logtake = 0;
29  data = data.select_features(o.idx_fea);
30  pieces = data_split_classes(data);
31 
32  h = arrayfun(@(s) ['<td class="tdhe">', s{1}, '</td>'], data.classlabels, 'UniformOutput', 0);
33  s = '';
34  s = cat(2, s, ['<h1>', '"', f.classtitle, '" table for dataset ', data.get_description(), '</h1>', 10, ...
35  '<p>FSG description: <b>', o.fsg.get_description(), '</b></p>', 10, ...
36  '<table class=bo>', 10, '<tr>', ...
37  '<td class="tdhe">class \ class</td>', strcat(h{:}), '</tr>', 10]);
38 
39  for i = 1:data.nc
40  s = cat(2, s, ['<tr><td class="tdle">', data.classlabels{i}, '</td>', 10]);
41 
42  for j = 1:data.nc
43  ds = data_merge_rows(pieces([i, j]));
44  f.data = ds;
45  f = f.boot();
46  p = f.calculate_grades({1});
47 % p = vc.test(pieces(i).X(:, o.idx_fea), pieces(j).X(:, o.idx_fea)); %#ok<ASGLU>
48  s = cat(2, s, ['<td class="tdnu">', num2str(p), '</td>', 10]);
49  end;
50 
51  s = cat(2, s, ['</tr>', 10]);
52  end;
53 
54  s = cat(2, s, ['</table>', 10]);
55  end;
56  end;
57 end
function def_fsg_testtable(in out)
Dataset class.
Definition: irdata.m:30
Generated by irreport, carries HTML contents.
Definition: log_html.m:2
function data_split_classes(in data, in hierarchy)
FSG - Feature Subset Grader.
Definition: fsg.m:6
Report base class.
Definition: irreport.m:8
function data_merge_rows(in datasets)