-
Notifications
You must be signed in to change notification settings - Fork 45
/
demo_kendall.m
executable file
·48 lines (39 loc) · 1.59 KB
/
demo_kendall.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% -------------------------------------------------------------------------
% Description:
% Demo script to calculate the Kendall coefficient of agreement
% This script reproduces the results of Figure 4 in our paper.
%
% Citation:
% A Comparative Study for Single Image Blind Deblurring
% Wei-Sheng Lai, Jia-Bin Huang, Zhe Hu, Narendra Ahuja, and Ming-Hsuan Yang
% IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016
%
% Contact:
% Wei-Sheng Lai
% University of California, Merced
% -------------------------------------------------------------------------
%% input dataset and attributes
dataset = 'real';
% dataset = 'uniform';
% dataset = 'nonuniform';
attribute = {};
attribute{end+1} = 'manmade';
attribute{end+1} = 'natural';
attribute{end+1} = 'people';
attribute{end+1} = 'saturated';
attribute{end+1} = 'text';
attribute{end+1} = 'all';
num_method = 14; % total number of evaluated methods
fprintf(' %10s | %10s | %8s\n', 'dataset', 'attribute', 'kendall');
fprintf('------------------------------------\n')
for a = 1:length(attribute)
%% load votes
vote_filename = fullfile('votes', sprintf('votes_%s_balance_%s.csv', dataset, attribute{a}));
M = csvread(vote_filename, 1, 0); % offset the first row to skip header
%% convert M to winning matrix
C = construct_winning_matrix(M, num_method);
%% compute kendall coefficient of agreement
k = coefficient_of_agreement(C);
fprintf(' %10s | %10s | %f\n', dataset, attribute{a}, k);
end