function [ICA_mat]=ICA(udir_mat,cora_cites,Test,Train,Label,ID_Feature,InClassifier,PCA)
%% Definition
Num_Feature=size(ID_Feature,2)-1;
N_Label=size(unique(Label),1);
tmp_confMat= zeros(N_Label,N_Label,size(Test,2));
tmp_accuracy=zeros(size(Test,2),1);
for i = 1 : size(Test,2)
    Recognized_Label=Label;
    %% bootstrapping
    for Unobserved = Test(:,i)'
        [Neighbor_Train,Neighbor_Label,Test_Feature,Test_Lable,Test_Index]=SetTestTrain(Unobserved,ID_Feature,Label,udir_mat,Train(:,i));
        [confMat,conf,accuracy,Recognized_Label(Test_Index)] = InnerClassifier(Neighbor_Train,Neighbor_Label,Test_Feature,Test_Lable,Label,InClassifier,1);
    end
    
    %% iterative classification
    AA=Recognized_Label;
    Converge = 0;
    Function= 'Sum'; % Aggrigation function 'Sum','Presence'
    Itration=0;
    Err1=[];
    Err2=[];
    Arr_Def=zeros(1,10);
    while (~Converge)
        Current_Label=Recognized_Label;
        [Feature] = Modified_Feature(Current_Label,ID_Feature,udir_mat,Function);
        %% PCA
        if PCA==1
            feature=PCA_fun(Feature(:,2:end),Label);
            Feature=[Feature(:,1),feature];
        end
        % %%%%%%%%%%%%%%%%
        for Unobserved = Test(:,i)'
            [Neighbor_Train,Neighbor_Label,Test_Feature,Test_Lable,Test_Index]=SetTestTrain(Unobserved,Feature,Current_Label,udir_mat);
            [confMat,conf,accuracy,Recognized_Label(Test_Index)] = InnerClassifier(Neighbor_Train,Neighbor_Label,Test_Feature,Test_Lable,Current_Label,InClassifier,0);
        end
        Itration=Itration+1;
        [Converge,Arr_Def] = Coverage_Checking(Recognized_Label,Current_Label,size(Test,1),Itration,Arr_Def);
%         same=sum((Recognized_Label ~= Label)& AA);
%         AA=(Recognized_Label ~= Label);
%         Index_AA(:,Itration)=AA;
%         Err1=[Err1,sum(abs(Recognized_Label ~= Current_Label))];
        Err2=[Err2,sum(abs(Recognized_Label ~= Label))];
%         plot(Err1,'r');
%         hold on;
        plot(Err2,'b');
        M(Itration)=getframe;     
    end
    Test_L=Label(ismember(Feature(:,1),Test(:,i)));
    Test_pred=Current_Label(ismember(Feature(:,1),Test(:,i)));
    tmp_confMat(:,:,i) = myconfusionmat(Test_L,Test_pred);
    tmp_conf=sum(Test_pred==Test_L)/length(Test_pred);
    tmp_accuracy(i)= tmp_conf*100;
end
ICA_mat.confMat= tmp_confMat;
ICA_mat.accuracy= tmp_accuracy;
return