www.pudn.com > maldicode.zip > fPeakSelection.m


 
%% Ant Colony Optimization 
 
clear all; close all; clc 
 
y = load ('CaseCirr'); 
 
[row, col]= size(y.sample_tr); 
objf = @objf_svm_ACOkfold; 
 
%% Calculate Signal-to-Noise ratio 
 
    ca = y.sample_tr(:,find(y.label_tr == 1)); 
    co = y.sample_tr(:,find(y.label_tr == 3)); 
        meanca = mean(ca,2); 
        meanco = mean(co,2);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
        stdca  = std(ca,0,2); 
        stdco  = std(co,0,2); 
    S2N = abs((meanca - meanco)./(stdca + stdco)); 
 
S2Nsorted = sortbycold([(1:row)' S2N],2); 
 
%% Run the ACO-SVM Algorithm 
 
%---------------------------------------------------------------------- 
 
markers = []; 
nruns = 100;             % no: of runs needed for ACO  
m           = 5;       % # features to be selected  
na          = 50;      % # particles/ants 
p           = 3;       % range between 1 and m-1. 
SSt ={}; 
for n =1:nruns 
    n 
    [S_best, best, err_best, err_S_best, err_S2N] = peak_ACO_S2N(y,S2N,m,na,p,objf); 
     
    markers = [markers; S_best(1,:)]; 
     
    save ACO_markers_one markers  
end 
 
%----------------------------------------