IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
as_fsel_eclass.m
Go to the documentation of this file.
1 %> @brief eClass-based feature selection
2 %>
3 %> @todo Temporarily deactivated
4 %>
5 %> Issue is similar to one wih LDA loadings: negative-positive-negative-positive-...
7  properties
8  %> =10.
9  nf_select = 10;
10  %> =0.03.
11  threshold = .03;
12  type = 'fea';
13  end;
14 
15  properties(SetAccess=protected)
16  clssr = [];
17  sgs = [];
18  koeff = [];
19  end;
20 
21  methods
22  function o = as_fsel_eclass()
23  o.classtitle = 'eClass';
24  o.flag_params = 0;
25  o.flag_ui = 0;
26  end;
27  end;
28 
29 % methods
30 % function log = do_use(o, data)
31 % idxsobs = sgs_get_obs_idxs(o.sgs, data);
32 % no_reps = length(idxsobs.reps);
33 %
34 % X = data.X;
35 %
36 % koeff = zeros(size(X, 2)+1, 1);
37 %
38 % for i_rep = 1:no_reps
39 % fprintf('$*$*$*$ as_fsel_eclass session %d/%d. $*$*$*$\n', i_rep, no_reps);
40 %
41 % idxstraintest = idxsobs.reps(i_rep).obs;
42 % d_train = data.map_rows(data, idxstraintest.train);
43 %
44 % o.clssr = o.clssr.boot();
45 % o.clssr = o.clssr.train(d_train);
46 %
47 % for i_rule = 1:o.clssr.no_rules
48 % koeff = koeff+sum(o.clssr.rulesets(o.clssr.rule_map(i_rule, 1)).rules(o.clssr.rule_map(i_rule, 2)).pi, 2);
49 % end;
50 % end;
51 %
52 % % - Discards the bias
53 % % - Makes it a row vector to be more consistent with usual disposition of variables as columns
54 % % - Absolute value is taken because negative values are as important as positive ones
55 % koeff = abs(koeff(2:end))';
56 %
57 %
58 % % Now the feature selection
59 %
60 % if o.type == 'fea'
61 % [values, indexes] = sort(koeff, 'descend');
62 % o.v = sort(indexes(1:o.nf_select));
63 % else
64 % indexes = 1:size(X, 2);
65 % o.v = indexes(koeff/sum(koeff) >= o.threshold);
66 % end;
67 %
68 % o.koeff = koeff;
69 % end;
70 % end;
71 end
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
Classifiers base class.
Definition: clssr.m:6
Analysis Session (AS) base class.
Definition: as.m:6
eClass-based feature selection
Definition: as_fsel_eclass.m:6
Analysis Session that produces a log_as_fsel.
Definition: as_fsel.m:2