4 %>@brief Processor of a set of subsets of features
6 %> @arg Histogram generation
7 %> @arg
"grades" vector calculation from histogram
10 %> Set the @ref subsets and @ref nf properties, and call go().
12 %> Of course there is a lot of customization. @ref nf4gradesmode, @ref nf4grades, @ref staibilitythreshold, @ref weightmode, and @ref stabilitype are
13 %> all properties that affect the way in which @ref grades is calculated.
15 %> @ref gradethreshold is applied after @ref grades has been calculated.
18 %> Number of position-related histograms to add up to form the grades. If not specified, will use the maximum
22 %> @arg @c
'fixed' will apply the number specified by the @ref nf4grades
property
23 %> @arg @c
'stability' will use a stability threshold (@ref stabilitythreshold property).
24 %> Per-position stabilities will be calculated according to @ref stabilitytype
25 nf4gradesmode =
'fixed';
27 %> =0.05 (5%). Stability threshold specified
as a percentage of maximum stability found.
28 stabilitythreshold = .05;
30 %> =
'uniform'. This is how the hits will be weighted in order to generate an overall histogram
31 %> @arg
'uniform' All hits will have weight 1
32 %> @arg
'stability' ....... kun
' Hits will have weights depending on the univariate Kuncheva stability index of the selection position
33 %> (i.e., 1st feature to be selected, 2nd feature to be selected etc)
35 %> I honestly think that 'uniform
' is the best option to keep things simple.
36 weightmode = 'uniform
';
38 %> ='kun
'. stability type to pass to the function ref featurestability.m
39 stabilitytype = 'kun
';
41 % Post-processing of the HISTOGRAMS AFTER generated
43 %> =0. Minimum number of hits within the histogram matrix. All values will be trimmed to zero below that. It is expressed
44 %> as a fraction of the total number of hits of each position-wise histogram.
49 function o = subsetsprocessor()
50 o.classtitle = 'Feature subsets processor
';
57 methods(Access=protected)
58 function log = do_use(o, input)
60 log.hitss = o.get_hitss(input);
62 n = o.get_nf4grades(input);
65 log.grades = sum(log.hitss(1:n, :), 1);
66 log.xname = input.xname;
67 log.xunit = input.xunit;
68 log.fea_x = input.fea_x;
76 function n = get_nf4grades(o, input)
77 switch o.nf4gradesmode
79 n = o.get_nf_select(input);
80 if isempty(o.nf4grades)
81 n = min(o.nf4grades, n);
84 w = o.get_stabilities(input);
86 ii = find(w/wmax < o.stabilitythreshold);
90 n = o.get_nf_select(input);
94 irerror(sprintf('nf4gradesmode
"%s" invalid
', o.nf4gradesmode));
98 %> Calculates the number of features to be selected as the maximum subset size
99 function n = get_nf_select(o, input)
100 n = max(cellfun(@numel, input.subsets));
104 %> Returns the "Hit Weights".
106 %> Hit weights are used to give, when assembling the histograms, more importance to variables that are selected first
107 function w = get_positionweights(o, input)
108 nnf = o.get_nf_select(input);
114 irerror('"lin" not implemented yet
');
116 irerror('"exp" not implemented yet
');
118 irerror('"sig" not implemented yet
');
120 w = o.get_stabilities(input);
125 %> Calculates histss from the subsets property.
126 function H = get_hitss(o, input)
127 subsets = input.subsets;
128 w = o.get_positionweights(input);
130 H = zeros(o.get_nf_select(input), numel(input.fea_x));
133 nreps = numel(subsets);
138 H(j, s(j)) = H(j, s(j))+w(j);
144 if o.minhits_perc > 0
146 H(H < ma*o.minhits_perc) = 0;
150 %> Returns a (feature position)x(stability curve)
152 %> Calculates according to the @ref stabilitytype property
153 function z = get_stabilities(o, input)
154 z = input.get_stabilities(o.stabilitytype, 'uni
');
Generated by fselrepeater, carries subsets of features.
Processor of a set of subsets of features.
Analysis Session (AS) base class.