1 %> @brief Learning curve: (percent dataset used
for training)x(classification rate)
3 %> The purpose of
this class is to store a cell of vectors (the @ref celldata property). The vectors may vary in size.
5 %> Each row has a different
"name" (@ref rownames property).
7 %> If generated by a @ref reptt_sgs, there will be one
case only (first log) and the changing conditions are the different blocks.
12 %> X-axis. Related to the columns of celldata
14 %> X-axis label. Related to the columns of celldata
16 %> X-axis unit. Related to the columns of celldata
18 %> X-axis label. Related to the rows of celldata
20 %> X-axis unit. Related to the rows of celldata
23 %> Cell of dimensions (number of cases)x(number of conditions per
case)
24 %> @arg Option 1: Cell of estlogs to extract the rate from
25 %> @arg Option 2: Cell of vectors (of various sizes) whose averages will be taken
27 %> Case names,
for legend
33 o.classtitle = 'Cell data';
34 o.moreactions = [o.moreactions, {
'extract_dataset'}];
40 %> Draws with hachures (optional)
42 %> @param idx=all Indexes of cases
43 %> @param flag_std=1 Whether to draw the standard deviation
as well
44 %> @param flag_perc_x=[] Whether to make the x-axis a percentage. If not passed, will use
internal setup
45 %> @param flag_perc_y=[] Whether to make the y-axis a percentage. If not passed, will use
internal setup
46 function draw(o, idx, flag_std)
47 if ~exist('idx', 'var') || isempty(idx)
48 idx = 1:size(o.celldata, 1);
51 if ~exist('flag_std', 'var') || isempty(flag_std)
58 if size(o.celldata, 1) < idx(i)
59 irerror(sprintf('celldata property has less than %d cases(s)!', idx(i)));
62 allvalues = o.celldata(idx(i), :);
63 curve = cellfun(@(x) mean(x), allvalues);
66 stds = cellfun(@(x) std(x), allvalues);
71 hh(i) = plot(o.fea_x, curve, 'Color',
find_color(i), 'LineWidth',
scaled(3));
72 legends{i} = o.rownames{idx(i)};
77 % p = polyfit(MX*o.fea_x, MY*curve, 9);
78 % pv = polyval(p, MX*o.fea_x);
79 % plot(MX*o.fea_x, pv,
'k--',
'LineWidth',
scaled(2));
85 title(o.get_description());
97 %> Dataset X will have same dimension of @ref celldata. Values will be the averages of each vector within @ref celldata
98 function data = extract_dataset(o)
99 [nrows, ncols] = size(o.celldata); %
#ok<NASGU>
101 data.X = cellfun(@(x) mean(x), o.celldata);
102 data.classes = (0:nrows-1)
';
103 data.classes = zeros(nrows, 1);
104 data.classlabels = o.rownames;
105 data.fea_x = o.fea_x;
106 data.xname = o.xname;
107 data.xunit = o.xunit;
108 data.yname = o.yname;
109 data.yunit = o.yunit;
110 data.title = ['Dataset generated by
', o.get_description()];
111 data = data.assert_fix();
function find_color(in i)
Property flag_ui
(GUI setting) Whether to "publish" in blockmenu and datatool. Note that a class can be "published" wi...
Analysis Session (AS) base class.
function draw_stdhachure(in xaxis, in curve, in stds, in color)
(dataset %) x (classification rate) curve
Learning curve: (percent dataset used for training)x(classification rate)