1 %> @brief Generated by @ref
fselrepeater, carries subsets of features
15 %> (Read-only) Cell containing the features selected at each repetition. This will be the base to build a histogram.
16 %> @note This has to be a cell because the number of selected features may not be fixed at each repetition. For example, feature selection
17 %> methods that pick peaks of the grades curve may find the grades curve to have eventually more or less peaks.
19 %> Dimensions [number of repetitions]; each element is a vector of dimension [o.as_fsel.nf_select (maximum)]
21 %> Meaning (Number of features)x(rate);
22 %> Dimensions [number of repetitions]x[o.as_fsel.nf_select]
23 %> The numbers are the calculated
"grades"
25 %> Maximum number of features selected
31 o.classtitle = 'Subsets log';
32 o.moreactions = [o.moreactions, {
'extract_dataset_nfxgrade',
'extract_dataset_stabilities'}];
37 function n =
get.nfmax(o)
38 n = max(cellfun(@numel, o.subsets));
42 %> @returns A cell of vectors
43 function out =
get.subsets(o)
51 %> @returns A matrix [number of repetitions]x[number of features selected]
52 function out =
get.nfxgrade(o)
57 temp = o.logs(i).nfxgrade;
58 out(i, 1:numel(temp)) = temp;
66 %> Returns a (feature position)x(stability curve)
68 %> @param type Type of stability measure (e.g.,
'kun')
69 %> @param type2
'uni' or
'mul'
72 function z = get_stabilities(o, type, type2)
73 if ~isempty(o.pvt_z) && strcmp(o.pvt_type, type) && strcmp(o.pvt_type2, type2)
81 %> Extract dataset to visualize FFS progress
83 %> Each row of the dataset shows the performance progression of a Forward Feature Selection (FFS) run.
84 function out = extract_dataset_nfxgrade(o)
88 if ~isprop(o.logs(1), 'nfxgrade')
89 irerror(sprintf('Logs of wrong class: "%s"', class(o.logs(1))));
94 out.classlabels = {
'Grade'};
95 out.
fea_x = 1:size(o.nfxgrade, 2);
96 out.xname =
'Number of features';
100 out.title =
'Number of features X Grades';
101 out = out.assert_fix();
104 %> Extract dataset with one row containing stability measures
106 %> @param type Type of stability measure (e.g.
'kun'). See @ref
featurestability.m
110 function out = extract_dataset_stabilities(o, type, type2)
111 if nargin < 3 || isempty(type)
114 if nargin < 3 || isempty(type2)
122 out.X = o.get_stabilities(type, type2);
123 out.classlabels = {
'Stability'};
124 out.
fea_x = 1:size(out.X, 2);
125 out.xname =
iif(type2 ==
'uni',
'Feature rank',
'Number of features');
127 out.yname =
'Stability';
129 out.title = sprintf(
'Stabilities (''%s'', ''%s'')', type, type2);
130 out = out.assert_fix();
133 %> Draws stacked histogram
for legend purpose only
134 function o = draw_stackedhist_for_legend(o)
139 hist.draw_stackedhists(ds_hint, {[], [.8, .8, .8]}, pd);
146 %> This system was set to speed up the report generation. Stability vectors won
't have to be recalculated
148 %> However, note that if o.subsets is reset, the following properties will get out of sync. So, use carefully.
149 properties(Access=private)
156 %> @brief Stores stabilities vector to prevent frequent recalculation
157 function o = calculate_stabilities(o, type, type2)
158 o.pvt_z = o.get_stabilities(type, type2);
Log generated by an as_fsel class.
function def_peakdetector(in out)
Analysis Session - Feature Selection Repeater.
Generated by fselrepeater, carries subsets of features.
function iif(in cond, in x1, in x2)
Property flag_ui
(GUI setting) Whether to "publish" in blockmenu and datatool. Note that a class can be "published" wi...
function featurestability(in subsets, in nf, in type, in type2)
Processor of a set of subsets of features.
Property fea_x
feature x-axis