-
Notifications
You must be signed in to change notification settings - Fork 0
/
test2.m
26 lines (24 loc) · 929 Bytes
/
test2.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
link_train =zeros(noOfUser,noOfUser);
for i = 1:size(train_pair,1)
link_train(find(userList == train_pair(i,1)),find(userList == train_pair(i,2))) = 1;
link_train(find(userList == train_pair(i,2)),find(userList == train_pair(i,1))) = 1;
end
link_test =zeros(noOfUser,noOfUser);
for i = 1:size(test_pair,1)
link_test(find(userList == test_pair(i,1)),find(userList == test_pair(i,2))) = 1;
link_test(find(userList == test_pair(i,2)),find(userList == test_pair(i,1))) = 1;
end
%compute auc value based on D
scores_googlenet2 = [];
y_googlenet2 = [];
for i=1:noOfUser
for j=i+1:noOfUser
if link_train(i,j)==0
scores_googlenet2 = [scores_googlenet2;D(i,j)];
y_googlenet2 = [y_googlenet2;link_test(i,j)];
end
end
end
[fpr,tpr,thresh,AUC] = perfcurve(y_googlenet2,scores_googlenet2,1)
[RECALL, PRECISION, INFO] = vl_pr(y_googlenet2-0.5,scores_googlenet2);
INFO.auc