IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fsg_test.m
Go to the documentation of this file.
1 %> @brief Feature subset grader that uses a statistical test
2 classdef fsg_test < fsg
3  methods(Access=protected)
4  % Abstract
5  function z = test(o, dd, idxs)
6  end;
7 
8  %> If @c sgs is set, performs cross-validation loop based on @c subddd, otherwise used @c datasets to test.
9  function z = do_calculate_pairgrades(o, idxs)
10  if ~o.flag_sgs
11  if ~o.pvt_flag_pairwise
12  z = o.test(o.datasets, idxs);
13  else
14  for i = size(o.datasets, 1):-1:1
15  z(i, :) = o.test(o.datasets(i, :), idxs);
16  end;
17  end;
18  else
19  nd = numel(o.subddd);
20  ni = numel(idxs);
21  z = zeros(nd, ni);
22  for i = 1:nd % Pairwise LOOP
23  dd = o.subddd{i};
24  nreps = size(dd, 1);
25 
26  ztemp = zeros(1, ni);
27  for j = nreps:-1:1 % Cross-validation loop.
28  ztemp(1, :) = o.test(dd(j, :), idxs);
29  end;
30  z(i, :) = ztemp/nreps; % Cross-validation average
31  end;
32  end;
33  end;
34 
35  end;
36 
37  methods
38  function o = fsg_test(o)
39  o.classtitle = 'Test';
40  end;
41  end;
42 end
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
Feature subset grader that uses a statistical test.
Definition: fsg_test.m:2
FSG - Feature Subset Grader.
Definition: fsg.m:6