diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-18 15:59:19 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-18 15:59:19 -0400 |
commit | 97e1498130a72f0a081b42759fa386a7460bb75d (patch) | |
tree | be897b69304081377ce39ce019a652eb73d5a9c1 /FEAST/FSToolbox/FCBF.m | |
parent | 49162177c5da0404d41f91f5f41006f0456babcd (diff) |
remove FEAST from our source, as our changes went upstream
Diffstat (limited to 'FEAST/FSToolbox/FCBF.m')
-rw-r--r-- | FEAST/FSToolbox/FCBF.m | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/FEAST/FSToolbox/FCBF.m b/FEAST/FSToolbox/FCBF.m deleted file mode 100644 index dcaf3bf..0000000 --- a/FEAST/FSToolbox/FCBF.m +++ /dev/null @@ -1,58 +0,0 @@ -function [selectedFeatures] = FCBF(featureMatrix,classColumn,threshold) -%function [selectedFeatures] = FCBF(featureMatrix,classColumn,threshold) -% -%Performs feature selection using the FCBF measure by Yu and Liu 2004. -% -%Instead of selecting a fixed number of features it provides a relevancy threshold and selects all -%features which score above that and are not redundant -% -% The license is in the license.txt provided. - -numFeatures = size(featureMatrix,2); -classScore = zeros(numFeatures,1); - -for i = 1:numFeatures - classScore(i) = SU(featureMatrix(:,i),classColumn); -end - -[classScore indexScore] = sort(classScore,1,'descend'); - -indexScore = indexScore(classScore > threshold); -classScore = classScore(classScore > threshold); - -if ~isempty(indexScore) - curPosition = 1; -else - curPosition = 0; -end - -while curPosition <= length(indexScore) - j = curPosition + 1; - curFeature = indexScore(curPosition); - while j <= length(indexScore) - scoreij = SU(featureMatrix(:,curFeature),featureMatrix(:,indexScore(j))); - if scoreij > classScore(j) - indexScore(j) = []; - classScore(j) = []; - else - j = j + 1; - end - end - curPosition = curPosition + 1; -end - -selectedFeatures = indexScore; - -end - -function [score] = SU(firstVector,secondVector) -%function [score] = SU(firstVector,secondVector) -% -%calculates SU = 2 * (I(X;Y)/(H(X) + H(Y))) - -hX = h(firstVector); -hY = h(secondVector); -iXY = mi(firstVector,secondVector); - -score = (2 * iXY) / (hX + hY); -end |