0001 function [ features ] = getRankedFeatures( cl )
0002
0003
0004
0005
0006
0007
0008 allFeatures = [];
0009
0010 weakCls = cl.trndCls;
0011 scores = abs(cl.clsWeights);
0012
0013 for i=1:length(weakCls)
0014 wcl = weakCls{i};
0015 wf = getFeaturesInfo(wcl);
0016
0017 for j=1:length(wf)
0018 wf(j).score = scores(i);
0019 end
0020 allFeatures = [allFeatures; wf];
0021 end
0022
0023
0024
0025 [~, ind] = sort([allFeatures.id]);
0026 allFeatures = allFeatures(ind);
0027
0028
0029 features = [];
0030 s = allFeatures(i).score;
0031 count = 1;
0032 for i=2:length(allFeatures)
0033 if allFeatures(i).id ~= allFeatures(i-1).id
0034 allFeatures(i-1).score = s;
0035 allFeatures(i-1).count = count;
0036 features = [features; allFeatures(i-1)];
0037 s = 0;
0038 count = 0;
0039 end
0040 s = s + allFeatures(i).score;
0041 count = count + 1;
0042 end
0043 allFeatures(end).score = s;
0044 allFeatures(end).count = count;
0045 features = [features; allFeatures(end)];
0046
0047
0048 [~, ind]= sort([features.score], 'descend');
0049 features = features(ind);
0050
0051 end
0052