1 %> @brief Records properties from a
block
4 %> Properties to record
6 %> (Optional) Units corresponding to each element in propnames. Will be used by get_unit(), but
this function is very tolerant
8 %> (Vector of booleans, same size of
ttlog_props::propnames). Whether the properties represent percentages or not. If
this property is not assigned properly, 0 will be assumed whenever there
9 %> is a lack of information.
11 %> Index of property to be used by the get_rate() method
15 properties(SetAccess=
protected)
16 %> Classifier
's relevant properties. This is a structure array ((fields))x(time)
20 methods(Access=private)
21 function z = get_flag_perc_(o, idx)
22 if (~isempty(o.flag_perc) && numel(o.flag_perc) >= idx)
30 methods(Access=protected)
31 %> Returns cell of strings for table header
32 function ss = get_collabels(o)
33 ss = fields(o.propvalues);
37 function o = do_allocate(o, tt)
39 o.propvalues = cell(1, numel(o.propnames));
40 for i = 1:numel(o.propnames)
41 o.propvalues{i} = vtemp;
47 function o = ttlog_props()
48 o.classtitle = 'Properties
';
50 o.moreactions = [o.moreactions, {'extract_dataset
'}];
54 % @todo Better to implement something to show detailed information in the future. In the meantime, this is NOT the solution
55 % function s = get_description(o)
57 % if ~isempty(o.propnames)
58 % ss = [' propnames =
' cell2str(o.propnames)];
60 % s = replace_underscores([class(o) ss]);
63 %> @param pars Structure with a @c .clssr field.
64 function o = record(o, pars)
68 % Records relevant properties from the classifier.
69 for i = 1:numel(o.propnames)
70 o.propvalues{i}(o.t) = clssr.(o.propnames{i});
74 %> @brief Returns recorded information
76 %> Each column corresponds to a different property.
78 %> @param aggr See below
80 %> <li>Aggregation:<ul>
81 %> <li>@c 0 - INVALID</li>
82 %> <li>@c 1 - Sum</li>
83 %> <li>@c 2 - INVALID</li>
84 %> <li>@c 3 - Mean</li>
85 %> <li>@c 4 - Standard Deviation</li></ul></li>
86 %> <li>@c 5 - Minimum</li></ul></li>
87 %> <li>@c 6 - Maximum</li></ul></li>
89 function X = get_X(o, aggr)
90 n = numel(o.propnames);
93 X(:, j) = o.propvalues{j}';
96 if exist(
'aggr',
'var') &&
aggr > 0
114 function s = get_insane_html(o, pars)
116 ff = o.get_collabels();
118 s = cat(2, s, '<h1>Classifier Properties</h1>', 10);
121 s = cat(2, s, '<table><tr><td class="tdhe"></td>', 10);
123 s = cat(2, s, '<td class="tdhe">', ff{i},
'</td>', 10);
125 s = cat(2, s,
'</tr>', 10);
127 aa = {
'Mean',
'Std',
'Min',
'Max'};
131 s = cat(2, s, '<tr><td class="tdle">', aa{i},
'</td>', 10);
133 s = cat(2, s, '<td class="tdnu">', num2str(X(1, j)), '</td>', 10);
135 s = cat(2, s, '</tr>', 10);
137 s = cat(2, s, '</table>');
140 %> Generates one dataset with columns being propnames.
141 function d = extract_dataset(o)
143 d.title = ['Classifier properties'];
145 d.fea_names = o.propnames;
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 %%% OVERWRITTEN BEHAVIOUR
154 %> Returns average recorded value for the property specified by
ttlog_props::idx_default
155 %> Pleas note that the name "rate" is unlikely to be the best denomination of what is actually returned (more likely to be time, or
156 %> number of rules etc). Of course, the name makes more sense in the @ref
estlog class
157 function z = get_rate(o)
158 z = mean(o.propvalues{o.idx_default});
161 %> Returns whether the value returned by get_rate() is a percentage or not
162 function z = get_flag_perc(o)
163 z = o.get_flag_perc_(o.idx_default);
168 %> Returns property name specified by
ttlog_props::idx_default. The @c title property can also be used. If the
ttlog's title is a
169 %>
string, will return the title instead
170 function z = get_legend(o)
179 function z = get_rates(o)
180 z = o.propvalues{o.idx_default};
183 function z = get_unit(o)
184 if iscell(o.propunits) && numel(o.propunits) >= o.idx_default
185 z = o.propunits{o.idx_default};
Base class for all ensemble classifiers.
Estimation logs base class.
function replace_underscores(in s)
Records properties from a block.
Property idx_default
Index of property to be used by the get_rate() method.
Property propnames
Properties to record.