3 %> @brief Calculates the stability curve
for a set of feature subsets
5 %> This
function is suitable
for feature subsets found
using Sequential Forward Feature Selection
7 %> Kuncheva
's "consistency" formula is I_c = (r-k^2/nf)/(k-k^2/nf), where r is the number of common elements in the two sets, and k is the
8 %> number of elements of either sets
11 %> <h3>References</h3>
13 %> Kuncheva, L. I. A stability index for feature selection, 390-395.
15 %> @param subsets matrix or cell of subsets. If matrix, each row is a subset. A subset contains feature indexes. If cell of subsets, all
16 %> subsets must have the same number of elements
17 %> @param nf Number of features
18 %> @param type ='kun
'. Type of stability measuse. Possibilities are:
19 %> @arg 'kun
' Kuncheva's Stability Index
20 %> @arg ... (open
for others)
22 %> @arg
'uni' evaluates position in subsets individually
23 %> @arg
'mul' evaluates considering m-sized subsets (m = 1..k)
25 %> @
return y nf x stability curve
28 if nargin < 3 || isempty(type)
32 if nargin < 4 || isempty(type2)
35 flag_uni = strcmp(type2, 'uni');
37 %> translates type into a function handle
42 irerror(sprintf('Feature consistency type "%s" not implemented', type));
45 % if cell, converts to matrix
50 [nsub, k] = size(subsets);
57 temp = subsets(:, 1:m);
61 y(m) = y(m)+f_type(temp(i, :), temp(j, :), nf);
65 y = y*2/(nsub*(nsub-1)); % takes the average consistency
function featurestability(in subsets, in nf, in type, in type2)
function subsets2matrix(in subsets)
function feacons_kun(in s1, in s2, in nf)