IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
blbl_extract_ds_from_sovalues.m
Go to the documentation of this file.
1 %> @brief Extracts dataset from sovalues
3  properties
4  %> ={[Inf, 0, 0], [1, 2]}
5  %> @sa sovalues.m
6  dimspec = {[Inf, 0, 0], [1, 2]};
7 
8  %> =rates
9  valuesfieldname = 'rates';
10  end;
11 
12  methods
14  o.classtitle = 'Extract dataset';
15  o.inputclass = {'sovalues'};
16  end;
17  end;
18 
19  methods(Access=protected)
20  function ds = do_use(o, sov)
21  [values, ax] = sovalues.get_vv_aa(sov.values, sov.ax, o.dimspec);
22 
23  ds = irdata();
24  ds.title = [sov.title, ' - ', o.valuesfieldname];
25 
26  V = permute(sov.getYY(values, o.valuesfieldname), [3, 2, 1]);
27  [no_folds, no_tuning, no_features] = size(V);
28 
29  ds.X = reshape(V, [no_folds*no_tuning, no_features]);
30  ds.classes = reshape(repmat(0:no_tuning-1, no_folds, 1), [no_folds*no_tuning, 1]);
31  ds.classlabels = ax(2).legends;
32 
33  ds.fea_names = sov.ax(1).ticks;
34  ds.xname = ax(1).label;
35  ds.xunit = '';
36  ds.fea_x = ax(1).values;
37  ds.yname = labeldict(o.valuesfieldname);
38  ds.yunit = '';
39 
40  ds = ds.assert_fix();
41  end;
42 
43  end;
44 end
Dataset class.
Definition: irdata.m:30
Extracts dataset from sovalues.
Other blocks.
Definition: blbl.m:3