IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fsg_test_t.m
Go to the documentation of this file.
1 %> @brief Feature subset grader - t-test
2 %>
3 classdef fsg_test_t < fsg_test
4  properties
5  %> =1. If 1, result of test is -log10(p-value); if 0, result is p-value
6  flag_logtake = 1;
7  end;
8 
9  methods(Access=protected)
10  function z = test(o, dd, idxs)
11  z = zeros(1, numel(idxs));
12  for i = 1:numel(idxs)
13  X = dd(1).X(:, idxs{i});
14  [dummy, z(i)] = ttest2(X(dd(1).classes == 0), X(dd(1).classes == 1), 0.05); % actually the third parameter (alpha) is irrelevant because we want the p-value only
15  end;
16  if o.flag_logtake
17  z = -log10(z);
18  end;
19  end;
20  end;
21 
22  methods
23  function o = fsg_test_t()
24  o.classtitle = 'T-Test';
25  o.flag_pairwise = 1;
26  o.flag_univariate = 1;
27  o.flag_params = 1;
28  end;
29  end;
30 end
Feature subset grader - t-test.
Definition: fsg_test_t.m:3
Feature subset grader that uses a statistical test.
Definition: fsg_test.m:2