function [X_test_stats,kNN_test_idx] = kNN_stats(X_train,X_test,y_train,k,numLabel)
%KNN_STATS 此处显示有关此函数的摘要
%   此处显示详细说明
    if nargin < 4
        k = 10;
    end
    num_dim = sum(numLabel,1);
    num_test = size(X_test,1);

    [~, dist_idx] = kNN_dist_mat(X_train, X_test, k);
    X_test_stats = zeros(num_test,num_dim);
    for x = 1:num_test
        neighbor_labels = [];
        for kk = 1:k
            neighbor_labels = [neighbor_labels,y_train(dist_idx(x,kk),:)']; % sum(numLabel)*k
        end
        temp_neighbor = sum(neighbor_labels,2);
        X_test_stats(x,:) = temp_neighbor';
    end
    kNN_test_idx = dist_idx(:,1:k);
end

