-
Notifications
You must be signed in to change notification settings - Fork 0
/
evaluateWebKBFull.m
74 lines (67 loc) · 2.02 KB
/
evaluateWebKBFull.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
clear;
% file1 = 'webKBFullNoLinksResultsJoint3Ex';
% file3 = 'webKBFullNoLinksResultsJoint3Ex';
file1 = 'webKBFullResultsJoint1Ex';
file3 = 'webKBFullResultsJoint3Ex';
% file1 = 'webKBSynthResultsJoint1Ex';
% file3 = 'webKBSynthResultsJoint3Ex';
% file1 = 'webKBSmallResultsJoint1Ex';
% file3 = 'webKBSmallResultsJoint1Ex';
%%
load(file1);
set(0,'DefaultAxesFontSize',14)
figure(1);
clf;
subplot(211);
semilogx(Cvec, mean(testError(:,:,1), 2), 'r');
hold on;
semilogx(Cvec, mean(trainError(:,:,1), 2), 'r--');
semilogx(Cvec, mean(testError(:,:,2), 2), 'b');
semilogx(Cvec, mean(trainError(:,:,2), 2), 'b--');
hold off;
legend('M3N-test', 'M3N-train', 'CSM3N-test', 'CSM3N-train', 'Location', 'Best');
title('Train on 1, test on 3');
xlabel('C');
ylabel('avg. per-page error');
load(file3);
subplot(212);
semilogx(Cvec, mean(testError(:,:,1), 2), 'r');
hold on;
semilogx(Cvec, mean(trainError(:,:,1), 2), 'r--');
semilogx(Cvec, mean(testError(:,:,2), 2), 'b');
semilogx(Cvec, mean(trainError(:,:,2), 2), 'b--');
hold off;
legend('M3N-test', 'M3N-train', 'CSM3N-test', 'CSM3N-train', 'Location', 'Best');
title('Train on 3, test on 1');
xlabel('C');
ylabel('avg. per-page error');
%%
figure(2);
clf;
load(file1);
for i = 1:length(schools)
subplot(2,4,i);
semilogx(Cvec, testError(:,i,1), 'r-x');
hold on;
semilogx(Cvec, trainError(:,i,1), 'r--x');
semilogx(Cvec, testError(:,i,2), 'b-x');
semilogx(Cvec, trainError(:,i,2), 'b--x');
hold off;
title(sprintf('Train on %s, test on rest', schools{i}));
xlabel('C');
ylabel('per-page error');
end
load(file3);
for i = 1:length(schools)
subplot(2,4,4+i);
semilogx(Cvec, testError(:,i,1), 'r-x');
hold on;
semilogx(Cvec, trainError(:,i,1), 'r--x');
semilogx(Cvec/100, testError(:,i,2), 'b-x');
semilogx(Cvec/100, trainError(:,i,2), 'b--x');
hold off;
title(sprintf('Train on 3, test on %s', schools{i}));
xlabel('C');
ylabel('per-page error');
end
legend('M3N-test', 'M3N-train', 'CSM3N-test', 'CSM3N-train', 'Location', 'SouthEast');