-
Notifications
You must be signed in to change notification settings - Fork 0
/
Demo_MSRCV1.m
36 lines (32 loc) · 1.14 KB
/
Demo_MSRCV1.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
clear;clc;
addpath('./ClusteringMeasure');
load('./data/MSRA_6view.mat');
fprintf('CBFMSC on MSRCV1 dataset\n');
numC = size(unique(gt),1);
for i = 1:6
X{i} = X{i}./repmat(sqrt(sum(X{i}.^2,1)),size(X{i},1),1);
end
NMI_all = [];
ACC_all = [];
F_all = [];
AVG_all = [];
P_all = [];
RI_all = [];
opts.lambda_1 = 100;
opts.rho = 1.9;
opts.dim_V = 35;
fprintf('lambda_1 = %f, dim_V = %d\n', opts.lambda_1,opts.dim_V);
for i = 1:30
fprintf('Clustering in %d-th iteration\n',i);
[U,V] = CBFMSC(X,opts);
[NMI,ACC,F,AVG,P,RI] = ClusteringResults(U,V,gt,numC);
fprintf('\tNMI: %f, ACC: %f, F: %f, AVG: %f, P: %f, RI: %f\n',NMI,ACC,F,AVG,P,RI);
NMI_all = [NMI_all, NMI];
ACC_all = [ACC_all, ACC];
F_all = [F_all, F];
AVG_all = [AVG_all, AVG];
P_all = [P_all, P];
RI_all = [RI_all, RI];
end
fprintf('---------------Average Results--------------\n');
fprintf('NMI: %f(%f), ACC: %f(%f), F: %f(%f), AVG: %f(%f), P: %f(%f), RI: %f(%f)\n', mean(NMI_all),std(NMI_all),mean(ACC_all),std(ACC_all),mean(F_all),std(F_all),mean(AVG_all),std(AVG_all),mean(P_all),std(P_all),mean(RI_all),std(RI_all));