-
Notifications
You must be signed in to change notification settings - Fork 6
/
runFastMICE.m
72 lines (62 loc) · 2.51 KB
/
runFastMICE.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This is the source code for the FastMICE algorithm, which is proposed %
% in the following paper: %
% %
% Dong Huang, Chang-Dong Wang, Jian-Huang Lai. %
% Fast Multi-view Clustering via Ensembles: Towards Scalability, %
% Superiority, and Simplicity. %
% IEEE Transactions on Knowledge and Data Engineering, accepted, 2023. %
% %
% The code has been tested in Matlab R2019b on a PC with Windows 10. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Label = runFastMICE(fea, trueK, Msize, p, Knn, distance)
% Huang Dong. Mar. 7, 2022.
if nargin < 3
distance = 'euclidean';
end
if nargin < 3
Knn = 5;
end
if nargin < 3
p = 1000;
end
if nargin < 3
Msize = 20;
end
lowerFeatureRatio = 0.2; % Minimum ratio of feature sampling
upperFeatureRatio = 0.8; % Maximum ratio of feature sampling
% Msize = 20; % Number of base clusterings
% p = 1000; % Total number of anchors in a view group
% Knn = 5; % Total number of nearest neighbors in a view group
% For text dataset, the Cosine distance is suggested.
% distance = 'cosine';
lowerK = 1; % The minimum number of clusters in a base clustering is lowerK * trueK
upperK = 2; % Maximum number of clusters in a base clustering
nView = length(fea);
N = size(fea{1},1);
% The number of anchors cannot exceed the number of instances.
if p > N
p = N;
end
%% Generate base clusterins
minK = lowerK*trueK;
maxK = upperK*trueK;
% tic1 = tic;
disp(['.']);
disp(['Start generating ', num2str(Msize), ' base clusterings via view-sharing bipartite graphs... ']);
disp(['.']);
IDX = FastMICE_EnsembleGeneration(fea, Msize, p, Knn, minK, maxK,lowerFeatureRatio,upperFeatureRatio,distance);
disp(['.']);
disp(['Ensemble generation completed.']);
% toc(tic1);
% tic2 = tic;
disp(['.']);
disp(['Start multi-view consensus function ... ']);
ticCon = tic;
Label = FastMICE_ConsensusFunction(IDX,trueK,20,5);
disp(['.']);
toc(ticCon);
disp(['Multi-view consensus functoin completed.']);
% toc(tic2);