% clc
% clear
% close all
% window=[15 13 6 12];
% load Fp.mat;
% load Fn.mat;
% load SSpositive.mat;
% load SSnegative.mat;
% load phychemical.mat;
% load label.mat;
% load negativeindex.mat;
% % load Positive.mat;
% % load Snegative.mat;
% load gtopfeature.mat;
% top=30;
% center=16;
% nn=size(Fp,1);
% mm=nn+negativeindex;
% tlabel=[label(1:nn,:);label(mm,:)];
% temp1=[Fp(:,(center-window(1,1)):(center+window(1,1)));Fn(negativeindex,(center-window(1,1)):(center+window(1,1)))];
% temp2=[];
% for i=1:size(SSpositive,3)
%     temp2=[temp2;SSpositive((center-window(1,2)):(center+window(1,2)),1,i)' SSpositive((center-window(1,2)):(center+window(1,2)),2,i)' SSpositive((center-window(1,2)):(center+window(1,2)),3,i)'];
% end
% for i=1:size(negativeindex,2)
%     temp2=[temp2;SSnegative((center-window(1,2)):(center+window(1,2)),1,negativeindex(i))' SSnegative((center-window(1,2)):(center+window(1,2)),2,negativeindex(i))' SSnegative((center-window(1,2)):(center+window(1,2)),3,negativeindex(i))'];
% end
% temp3=[];
% pindex=1:nn;
% pindex=[pindex mm];
% m=size(phychemical,3);
% m=20;
% for i=1:m
%     temp3=[temp3 phychemical(pindex,(center-window(1,3)):(center+window(1,3)),i)];
% end
% temp4=[PCKSAAP;NCKSAAP];
% aar=[temp1 temp2 temp3 temp4];
% aar=zscore(aar);
% D=size(aar,2);
% [feature_ind,fit,value,v]=fselection(aar,tlabel);
% model=svmtrain(tlabel,aar(:,feature_ind),'-b 1');
% % save('model.mat','model');
% % save('feature_ind.mat','feature_ind');

set(gcf,'color','white');
x=1:size(aar,2);
plot(x,value,'k','MarkerFaceColor','r','LineWidth',2);
set(gca,'LooseInset',get(gca,'TightInset'))
% set(gca,'XTick',x,'XTickLabel',v);
xlabel('the number of features');
ylabel('AUC');
indk=feature_ind;
str=[];
for i=1:length(indk)
    ij=find(v==indk(i));
    text(ij,value(ij),'*','color','red');
end
ym=max(value);
ind=find(value==ym);
ind=ind(end);
str=['(',num2str(ind),',',num2str(ym),')'];
text(ind,ym,str);
hold on;
plot([0 ind],[ym ym],'r--','LineWidth',1);
plot([ind ind],[0 ym],'r--','LineWidth',1);
hold off;
% xlabel('the number of features');
% ylabel('AUC');
