function k_tau = evaluate_model(config, file_info, feat_types, model);
fprintf('Evaluating model.\n');
config.paths.pred_results = config.paths.model_results;
n_files = file_info.num_files;
n_lab = length(config.data_info.labels);

all_con_pairs = zeros(n_files, ((n_lab*(n_lab - 1))/ 2));
all_dis_pairs = zeros(n_files, ((n_lab*(n_lab - 1))/ 2));

parfor file_i = 1:n_files
    % File name and paths
    [parent_dirs, name_root] = get_file_info_entry(file_info, file_i);

    [img_pred, img_rank] = ...
        predict_single_image(config, model, feat_types, ...
                             parent_dirs, name_root);

    gt_label = load_ground_truth(parent_dirs, name_root, config.load_params);

    [con_pairs, dis_pairs] = evaluate_rank_prediction(img_rank, gt_label);
    all_con_pairs(file_i, :) = con_pairs;
    all_dis_pairs(file_i, :) = dis_pairs;
end
k_tau = (sum(all_con_pairs(:)) - sum(all_dis_pairs(:)))./ ...
        (sum(all_con_pairs(:)) + sum(all_dis_pairs(:)));
end
