-
Notifications
You must be signed in to change notification settings - Fork 1
/
EnsembleGeneration_parallel.m
26 lines (22 loc) · 1.4 KB
/
EnsembleGeneration_parallel.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% If you find the code useful for your research, please cite the paper %
% below: %
% %
% D. Huang, C.-D. Wang, H. Peng, J. Lai, & C.-K. Kwoh. "Enhanced Ensemble %
% Clustering via Fast Propagation of Cluster-wise Similarities."To appear %
% in IEEE Transactions on Systems, Man, and Cybernetics: Systems. %
% DOI: 10.1109/TSMC.2018.2876202 %
% %
% The code has been tested in Matlab R2016a and Matlab R2016b. %
% %
% www.researchgate.net/publication/328581758 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function baseCls = EnsembleGeneration_parallel(fea, M, lowerK, upperK)
% This function generates M base clusterings by k-means.
% Each base clustering is generated by k-means with the cluster number randomly selected in [lowerK, upperK].
N = size(fea,1);
clsNums = randi([lowerK, upperK],M,1);
baseCls = zeros(N,M);
parfor i = 1:M % This is a paralleled version
baseCls(:,i) = kmeans(fea, clsNums(i));
end