load data
data=data';
load pami_index
for i=1:numel(index);
train_data=data(1:250,index(1:i));
train_label=data(1:250,149);
test_data=data(251:300,index(1:i));
test_label=data(251:300,149);
split_parts=5;
c_begin=1;c_step=25;c_end=500;
g_begin=1;g_step=1;g_end=1;
coef_begin=0;coef_step=1;coef_end=1;
d_begin=2;d_step=1;d_end=8;
tolerance=0.001;
cut_off=0;
 [Train_accuracy,Test_Accuracy,bestd,bestc,bestg,bestcoef,pred_label,func_res,obj_results]=poly_train_unbalanced_new(train_data,train_label,test_data,test_label,split_parts,c_begin,c_step,c_end,...
    g_begin,g_step,g_end,coef_begin,coef_step,coef_end,d_begin,d_step,d_end,tolerance,cut_off);
[True1Estimated1,True0Estimated0,True1Estimated0,True0Estimated1]=compare_labels(test_label,pred_label,Test_Accuracy,obj_results);

results(i,1)=Train_accuracy;results(i,2)=Test_Accuracy;
results(i,3)=True1Estimated1;results(i,4)=True0Estimated0;results(i,5)=True1Estimated0;results(i,6)=True0Estimated1;
save results_polynomial
end
 for u=1:4;
results(u,7)=100*((results(u,3)+results(u,4)))/50;
 end
filename='poly_results';    
xlswrite(filename,results);          

