File Exchange

image thumbnail

Swarm Rapid Centroid Estimation: A particle swarm clustering algorithm

version 1.21 (14.1 KB) by

An efficient particle swarm approach for rapid optimization of cluster centroids.



View License

RCE Rapid Centroid Estimation (RCE) clustering (2014): A semi-stochastic lightweight clustering algorithm using particle swarm.
Example Usage:

% An example run of the algorithm using Iris Dataset

clear all
close all;

% load iris dataset
load iris_dataset
X = irisInputs;
N = size(irisInputs,2);

% set the fuzzifier constant to 1.4
m = 1.4;

% Optimize the swarm using 80% resampling rate and mahalanobis distance
swarm = RCE(X, 3, 'distance','mahalanobis','fuzzifier',m, 'display','text', ...
'swarm',6, 'subsprob',0.03, 'maxiter',100,'resampling_rate',0.8,'calculate_labels', false);

% calculate the fuzzy labels, crisp labels, and numeric labels from the
% input vectors using the Swarm
[softlabels, crisplabels, numlabels] = swarm_cluster(X,swarm);

% plot the fuzzy voronoi cells on the 1st and 3rd dimension

% Perform fuzzy evidence accumulation on the swarm
ensemble = EnsembleAggregate(softlabels,'average',true);

% plot the scatter matrix

RCE is proposed as a derivate of PSC algorithm with radically reduced time complexity. The quality of the results produced are similar to PSC. The advantage of RCE is RCE has lesser complexity, faster convergence, and reduced likelihood of suboptimal convergence [1-2]. Recent updates to RCE removes the redundancies of RCE and further decrease the overall complexity, enabling it to perform Ensemble Clustering in quasilinear complexity. The additional algorithms are Tsaipei-Wang's co-association tree (CA-tree) and Fuzzy Evidence Accumulation. The code for CA-tree will be provided in the next update.

[1] M. Yuwono, S.W. Su, B. Moulton, & H. Nguyen, "Data Clustering Using
Variants of Rapid Centroid Estimation", IEEE Transactions on
Evolutionary Computation, Vol 18, no.3, pp.366-377. ISSN:1089-778X.
[2] M. Yuwono, S.W. Su, B. Moulton, H. Nguyen, "An Algorithm for Scalable
Clustering: Ensemble Rapid Centroid Estimation", in Proc 2014 IEEE
Congress on Evolutionary Computation, 2014, pp.1250-1257.

Copyright 2011-2014 Mitchell Yuwono.
$Revision: 1.2.0 $ $Date: 2014/11/10 18:02:00 $

Comments and Ratings (3)


Mr.Su (view profile)

Quang Lam

Please upload the data set iris_dataset.
Thank you,

Ahmad Azar



Disabled automatic calculation of labels and covariance matrices at the end of RCE.m for usability on larger datasets. Added swarm_cluster.m for this purpose.
Added inverse_covariance.m for inverting Sigma_inv if needed.
Added weighted_covariance.m


Bug fix in the main file RCE.m with regards to best position matrix updating. Final clustering quality is improved.


Corrected a bug in the visualize_swarm code. Updated the screenshot to showcase the visualization tools.


Implemented beta divergence for seeding the swarm when using mahalanobis distance.
a function to visualize the swarm in two dimensions using fuzzy voronoi cells.
a function to calculate the fuzzy consensus from the swarm.
a demo file.


Major update due to Ensemble Rapid Centroid Estimation (CEC 2014): Removed cognitive/social terms for further reducing the memory complexity. RCE code is completely rewritten. The results are now put inside a struct for convenience.


Major changes and bug fixes


Description updated


Updated Description

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today