function [Feature] = Modified_Feature(Current_Label,ID_Feature,udir_mat,Function)
    Y= unique(Current_Label);
    Feature= [ID_Feature , zeros(size(Current_Label,1),size(Y,1))];
    switch Function
        case 'Sum'
            for node = unique(udir_mat)'
                N_Index= ismember(udir_mat(:,1),node);
                % Finding the ID of observed neighbors
                N_ID = udir_mat(N_Index,2);
                % Finding the Features of the observed neighbors
                Index_Feature=ismember(ID_Feature(:,1),N_ID);
                % Finding the label of observed neighbors
                Neighbor_Label = Current_Label(Index_Feature);
                for i = Y'                  
                    Feature(ismember(ID_Feature(:,1),node),size(ID_Feature,2)+i)=sum(Neighbor_Label == i);
                end
            end
        case 'Presence'
            for node = unique(udir_mat)'
                N_Index= ismember(udir_mat(:,1),node);
                % Finding the ID of observed neighbors
                N_ID = udir_mat(N_Index,2);
                % Finding the Features of the observed neighbors
                Index_Feature=ismember(ID_Feature(:,1),N_ID);
                % Finding the label of observed neighbors
                Neighbor_Label = Current_Label(Index_Feature);
                for i = Y'                  
                    Feature(ismember(ID_Feature(:,1),node),size(ID_Feature,2)+i)=any(Neighbor_Label == i);
                end
            end
        otherwise
            error('Aggrigation function is not valid');
    end
    [Feature(:,size(ID_Feature,2)+1:end)] = Normalize(Feature(:,size(ID_Feature,2)+1:end));
return
