Code covered by the BSD License  

Highlights from
Semi-supervised Affinity Propagation clustering

from Semi-supervised Affinity Propagation clustering by Kaijun Wang
embed Silhouette index into iterations of Affinity propagation clustering to supervise its running

ind2cluster(labels)
function [clusters, newlabels] = ind2cluster(labels)

C = unique(labels);
newlabels = labels;
k = length(C);
clusters = cell(1,k);
for i = 1:k
  ind = find(labels==C(i));
  clusters{i} = ind;
  newlabels(ind) = i;
end

Contact us at files@mathworks.com