function augment_biased = aug_bias(X_train,y_train,kNN_idx,k,numLabel)
%AUG_BIAS 此处显示有关此函数的摘要
%   此处显示详细说明
    num_train = size(X_train,1);
    augment_biased = zeros(num_train,sum(numLabel,1));
    knn_score = 1./sqrt(1:k);
    upper_limit = 0.5;
    lower_limit = 0;

    for x = 1:num_train
        index = kNN_idx(x,:);
        idx_base = 0;
        for dd = 1:sum(numLabel,1)
            idx_base = idx_base+1;
            temp_score = 0;
            temp_num = 0;
            for kk = 1:k
                if y_train(index(kk),dd)==1
                    augment_biased(x,idx_base) = augment_biased(x,idx_base)+1;
                    temp_score = temp_score+knn_score(kk);
                    temp_num = temp_num+1;
                end
            end
            max_score = sum(knn_score(1:temp_num));
            min_score = sum(knn_score(k-temp_num+1:k));
            if min_score~=max_score
                temp_bias = (temp_score-min_score)/(max_score-min_score)*(upper_limit-lower_limit)+lower_limit;
                augment_biased(x,idx_base) = augment_biased(x,idx_base)+temp_bias;
            end
        end
    end
end

