1 function [listeFeatures, FC] =
fisherCrit(features, labels, nbClasses)
3 nbFeatures = size(features, 2);
4 nbSamples = size(features, 1);
6 FC = zeros(nbFeatures,1);
8 meanSamples = mean(features,1);
10 %pour chaque feature on calcul son critere de fisher
11 for(iFeat = 1:nbFeatures)
14 for(iClass =1:nbClasses)
15 meanClass = mean(features(labels==iClass,iFeat));
16 inter = inter + sum(labels==iClass)*(meanClass - meanSamples(iFeat))^2;
17 for(spl = find(labels==iClass)
')
18 intra = intra + (features(spl,iFeat) - meanClass)^2;
21 FC(iFeat) = inter / intra;
24 [FC listeFeatures] = sort(FC,'descend
');
25 listeFeatures = listeFeatures';