Code covered by the BSD License
-
[AR,RI,MI,HI]=RandIndex(c1,c2...
RANDINDEX - calculates Rand Indices to compare two partitions
-
[indx,ssw,sw,sb]=valid_cluste...
clustering validation indices
-
daisy(x,vtype,metric)
DAISY returns a matrix containing all the pairwise dissimilarities
-
ind2cluster(labels)
-
pam(x,kclus,vtype,stdize,metr...
PAM returns a list representing a clustering of the data into kclus
-
similarity_euclid(data)
data --- observations x dimensions, every collumn is standardized within [0, 1]
-
similarity_euclid(data)
-
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_findk(S, kfind, id, k, ...
-
valid_internal_deviation(data...
cluster validity indices based on deviation
-
valid_internal_intra(Smatrix,...
indices base on intra and inter similarity
-
valid_intrainter(Smatrix,U)
caculate intra similarity/distance and inter similarity
-
valid_plotall(validty, ks, B,...
preparing for plotting indices
-
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.
-
xlim(arg1, arg2)
-
mainClusterValidationNC.m
-
validity_Index.m
-
View all files
from
(simple) Tool for estimating the number of clusters
by Kaijun Wang
12 validity indices, illustrate estimation of the number of clusters
|
| similarity_pearsonC(data, C)
|
function R = similarity_pearsonC(data, C)
% pearson coefficients between every column and the center
% input matrix: data --- nrow rows * ncol columns
% output matrix: R --- ncol columns
[nrow,ncol] = size(data);
dm = mean(data);
data = data-repmat(dm,nrow,1);
C = C-mean(C);
R = ones(1,ncol);
X = sqrt(C'*C);
for j = 1:ncol
y = data(:,j);
xy = C'*y;
Y = sqrt(y'*y);
S = X*Y;
% if S == 0 S = NaN; end
R(j) = xy/S;
end
% Pearson similarity [-1,1] is normalized to Pearson distance [0,1]
R = 1-(1+R)*0.5;
|
|
Contact us at files@mathworks.com