IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fsg_test_fisher.m
Go to the documentation of this file.
1 %> Feature subset grader - Fisher's score: between-class variance divided by within-class variance
2 %>
3 %> <h3>Reference</h3>
4 %> Duda et al 2001, Pattern Classification
5 classdef fsg_test_fisher < fsg_test
6  methods(Access=protected)
7  function z = test(o, dd, idxs)
8  z = zeros(1, numel(idxs));
9  for i = 1:numel(idxs)
10  if numel(idxs{i}) > 1
11  irerror('This is a univariate test!');
12  end;
13 
14  [s_b, s_w] = calculate_scatters(dd(1).X(:, idxs{i}), dd(1).classes);
15 
16  z(i) = s_b/(s_w+realmin);
17  end;
18  end;
19  end;
20 
21  methods
22  function o = fsg_test_fisher(o)
23  o.classtitle = 'Fisher''s score';
24  o.flag_pairwise = 0;
25  o.flag_univariate = 1;
26  o.flag_params = 0;
27  end;
28  end;
29 end