IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
ovrcurves.m
Go to the documentation of this file.
1 %> @brief One-Versus-Reference calculation of grades curves
2 %>
3 %> Splits dataset using one-versus-reference split (blmisc_split_ovr), then calculates grades curve for each sub-dataset
4 %> using the FSG provided. Stores result in a log_ovrcurves
5 classdef ovrcurves < as
6  properties
7  hierarchy = [];
8  %> Index of reference class
9  idx_ref = 1;
10  %> FSG object to grade the data features
11  fsg;
12  end;
13 
14  methods
15  function o = ovrcurves()
16  o.classtitle = 'One-Versus-Reference grades curves';
17  o.flag_ui = 1;
18  end;
19  end;
20 
21  methods(Access=protected)
22  function out = do_use(o, data)
23 
24  temp = data_split_classes(data, o.hierarchy);
25  classmap = classlabels2cell(data.classlabels, o.hierarchy);
26  ii = 0;
27  for i = 1:length(temp)
28  if i ~= o.idx_ref
29  ii = ii+1;
30  datasets(ii) = data_merge_rows(temp([o.idx_ref, i])); %#ok<*AGROW>
31  datasets(ii).title = [classmap{i, 3} ' vs. ' classmap{o.idx_ref, 3}];
32  end;
33  end;
34  n = numel(datasets);
35 
36  da1 = datasets(1);
37  out = log_ovrcurves();
38  out.title = data.title;
39  out.fea_x = da1.fea_x;
40  out.xname = da1.xname;
41  out.xunit = da1.xunit;
42  out.yname = o.fsg.get_description();
43  out.gradess = zeros(n, da1.nf);
44  for i = 1:n
45  fsg_ = o.fsg;
46  fsg_.data = datasets(i);
47  fsg_ = fsg_.boot();
48  out.gradess(i, :) = fsg_.calculate_grades(num2cell(1:data.nf));
49  out.legends{i} = datasets(i).title;
50  end;
51  out.idx_ref = o.idx_ref;
52  end;
53  end;
54 end
55 
Stores set of grades as a matrix.
Definition: log_ovrcurves.m:4
One-Versus-Reference calculation of grades curves.
Definition: ovrcurves.m:5
Scans IRootLab directories and build hierarchical class maps.
Definition: classmap.m:7
function data_split_classes(in data, in hierarchy)
FSG - Feature Subset Grader.
Definition: fsg.m:6
Analysis Session (AS) base class.
Definition: as.m:6
function classlabels2cell(in classlabels, in new_hierarchy)
function data_merge_rows(in datasets)
One-Versus-Reference dataset split class combination.