-
Notifications
You must be signed in to change notification settings - Fork 29
/
run_reuters.m
74 lines (57 loc) · 1.75 KB
/
run_reuters.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
%
% Run MLRSSC on Reuters digit dataset. Parameters are optimized over NMI
% measure.
%
%-------------------------------------------------------
clear;
addpath(genpath(cd))
load reuters
X{1} = spconvert(EN_EN_sample);
X{2} = spconvert(EN_FR_sample);
X{3} = spconvert(EN_GR_sample);
X{4} = spconvert(EN_IT_sample);
X{5} = spconvert(EN_SP_sample);
k = 6;
num_iter = 100;
num_views = 5;
%% Linear kernel multi-view LRSSC
fprintf('\nPairwise multiview LRSSC\n');
opts.mu = 10^4;
lambda1 = 0.9;
lambda3 = 0.7;
opts.lambda = [lambda1 (1-lambda1) lambda3];
opts.noisy = true;
A = pairwise_MLRSSC(X, opts); % joint affinity matrix
[best.CA best.F best.P best.R best.nmi best.AR] = spectral_clustering(A, k, truth);
best
fprintf('\nCentroid multiview LRSSC\n');
opts.mu = 10^4;
lambda1 = 0.5;
lambda3 = 0.3;
opts.lambda = [lambda1 (1-lambda1) lambda3];
A = centroid_MLRSSC(X, opts); % joint affinity matrix
[best.CA best.F best.P best.R best.nmi best.AR] = spectral_clustering(A, k, truth);
best
%% Gaussian kernel multi-view LRSSC
opts.kernel = 'Gaussian';
opts.err_thr = 10^(-5);
for v=1:num_views
sigma(v) = opt_sigma(X{v});
end
opts.sigma = [5*sigma(1) 50*sigma(2) 50*sigma(3) 50*sigma(4) 10*sigma(5)];
fprintf('\nKernel pairwise multiview LRSSC\n');
opts.mu = 10^4;
lambda1 = 0.5;
lambda3 = 0.9;
opts.lambda = [lambda1 (1-lambda1) lambda3];
A = pairwise_MLRSSC(X, opts); % joint affinity matrix
[best.CA best.F best.P best.R best.nmi best.AR] = spectral_clustering(A, k, truth);
best
fprintf('\nKernel centroid multiview LRSSC\n');
opts.mu = 10^4;
lambda1 = 0.5;
lambda3 = 0.3;
opts.lambda = [lambda1 (1-lambda1) lambda3];
A = centroid_MLRSSC(X, opts); % joint affinity matrix
[best.CA best.F best.P best.R best.nmi best.AR] = spectral_clustering(A, k, truth);
best