Code covered by the BSD License
-
...
Handle arguments to function
-
[idx,netsim,dpsim,expref,unco...
-
ind2cluster(labels)
-
similarity_euclid(data,vararg...
-
similarity_pearson(data)
pearson coefficients between every two columns
-
similarity_pearsonC(data, C)
pearson coefficients between every column and the center
-
valid_errorate(labels, truela...
computing error rates for every clusters if true labels are given
-
valid_external(index1,c2)
-
valid_sumpearson(data,labels,...
within-, between-cluster and total sum of squares
-
valid_sumsqures(data,labels,k...
data: a matrix with each column representing a variable.
-
test_APclustering.m
-
View all files
from
Semi-supervised Affinity Propagation clustering
by Kaijun Wang
embed Silhouette index into iterations of Affinity propagation clustering to supervise its running
|
| similarity_pearson(data)
|
function R = similarity_pearson(data)
% pearson coefficients between every two columns
% input matrix: data --- nrow rows * ncol columns
% output matrix: R --- ncol * ncol matrix
[nrow,ncol] = size(data);
x = mean(data);
data = data-repmat(x,nrow,1);
R = ones(ncol,ncol);
for i = 1:ncol-1
x = data(:,i);
X = sqrt(x'*x);
for j = i+1:ncol
y = data(:,j);
xy = x'*y;
Y = sqrt(y'*y);
sim = xy/(X*Y);
R(i,j) = sim;
R(j,i) = sim;
end
end
|
|
Contact us at files@mathworks.com