1 %> @brief Forward Feature Selection
5 %> [1] L. C. Molina, L. Belanche, and a. Nebot, “Feature selection algorithms: a survey and experimental evaluation,”
6 %> 2002 IEEE International Conference on Data Mining, 2002. Proceedings., pp. 306-313, 2002. <b>Section 2.2.2</b>
8 %> @sa uip_as_fsel_forward.m
11 %> Feature Subset Grader
object.
13 %> =10. Number of features to be selected
19 o.classtitle = 'Forward';
24 methods(Access=protected)
25 function log = do_use(o, data)
30 nf_eff = min(o.nf_select, nf); % Effective number of features to be selected
33 nfxgrade = zeros(1, nf_eff);
36 flag_progress = ~isempty(o.
fsg.
sgs);
43 if flag_first && ~flag_progress
44 t = tic(); % Will record time to see if the iteration is "slow" (i.e., takes more than 1 second). If so, will "activate" the progress bar
46 irverbose(sprintf('Number of features: %d ...', i));
49 v_candidates = arrayfun(@(x) [v_in, x], v_left, 'UniformOutput', 0);
51 % Evaluates candidates
52 candidatesgrades = o.
fsg.calculate_grades(v_candidates);
53 g = candidatesgrades(:, :, 1);
56 % verifies whether there is more than one candidate with maximum grade
60 idx = ima(randi([1, n_ima])); % Random decision is probably the best that could be done here!
64 v_in = [v_in, v_left(idx)]; % Indexes of selected features
65 v_left(idx) = []; % Indexes of left features
66 nfxgrade(i) = val; % Recording of (nf)x(grade) sequence
69 irverbose(['Selection so far: ', mat2str(v_in)], 1);
70 if flag_first && ~flag_progress
89 log.nfxgrade = nfxgrade;
90 log.grades = zeros(1, nf);
91 % log.grades(log.v) = 1;
92 log.fea_x = data(1).fea_x;
93 log.xname = data(1).xname;
94 log.xunit = data(1).xunit;
95 log.yname = o.
fsg.get_yname();
96 log.yunit = o.
fsg.get_yunit();
function irverbose(in s, in level)
Log generated by a as_fsel_forward.
Base Sub-dataset Generation Specification (SGS) class.
function progress2_change(in prgrss, in title, in perc, in i, in n)
function progress2_open(in title, in perc, in i, in n)
Forward Feature Selection.
function progress2_close(in prgrss)
FSG - Feature Subset Grader.
Analysis Session that produces a log_as_fsel.