Code covered by the BSD License
-
SystemEvolution_energy(labels...
Energy computations for System Evolution to Estimate the Number of Clusters
-
SystemEvolution_findk(inter,i...
(2) collecting partition and merge energies gained
-
[A1,A2,B1,B2,A3,B3]=cluster_m...
Two-cluster model and twin-clusters
-
[A2,B2]=findnear(Dist,A1,na,B...
finding nearest elements between two groups A1 and B1
-
[Ra,na]=border_points(Dm,A1,B...
finding out nearest points between two groups A1 and B1
-
[S,T,singl,simter,kmin]=close...
finding such a border region of a cluster that is nearest another cluster
-
[ft,fd]=plotindice(ind,N1,N2,...
-
[inter,intra]=energy_euclid(D...
computing energies (average walking distance) within each group A1,B1,...
-
[inter,intra]=energy_pearson(...
computing energies (average walking distance) within each group A1,B1,...
-
[pcfirst,eigvect,eigval,pcord...
extracting PCA components from data (along dimensions)
-
daisy(x,vtype,metric)
DAISY returns a matrix containing all the pairwise dissimilarities
-
data_load(id,sw,nk,N2,type)
-
energy_compute(Dist,A1,A2,B1,...
-
energydiff_allclusters(Dist,l...
finding energies for all clusters
-
ind2cluster(labels)
-
nearest(z,xi);
NEAREST: return the vector zj in z that is nearest to xi
-
pam(x,kclus,vtype,stdize,metr...
PAM returns a list representing a clustering of the data into kclus
-
pam_running(data,N,Ns,type,st...
calculating dis-similarity/distance matrix of a data set
-
plot_evolution_route(data,lab...
-
plotdata_bylabels(data,classl...
plotting data in first two principle components (pc) or dimensions
-
regionF_find(Dmatrix,A1,B1,di...
-
remove_closest(Dm,Ra,Rb)
-
remove_outlier(Dmatrix,A1,nA)
-
show2dim_byclass(davec,clas,i...
showing 2-dimensional data in X-Y space
-
showClass_up(data, labels, hi...
-
similarity_euclid(data)
-
similarity_pearson(data)
pearson coefficients between every two columns
-
standarz(data)
-
valid_errorate(labels,truelab...
computing error rates for every clusters if true labels are given
-
valid_external(index1,c2)
-
walk_distance(Dmatrix,A,k,ch)
-
walk_route(DM, A1, startpoint...
-
xlim(arg1, arg2)
-
MainSystemEvolution.m
-
datasort_bylabel.m
-
View all files
from
Estimating the number of clusters via System Evolution
by Kaijun Wang
estimate number of clusters for far clusters, small-larger clusters, slightly overlapping clusters
|
| walk_route(DM, A1, startpoint,ch)
|
function [Rout, id, route] = walk_route(DM, A1, startpoint,ch)
ns = length(A1);
m = round(ns/2);
[nt, points] = sort(DM(startpoint,A1));
points = A1(points);
steppair = [];
route = [];
nt = startpoint;
for i=1:2
ra=(i-1)*m+1;
rb=i*m;
rc=m;
if i==2
rb=ns;
rc=rb-ra+1;
end
na=points(ra:rb);
nb=[nt na];
[id,Dm]=walk_propagat(1-DM(nb,nb),1);
Dm=1-Dm;
if i==1
nb=nb(id);
else
nb=nb(id(2:rc+1));
end
nt = nb(rc);
steppair = [steppair nb];
route = [route Dm];
end
route = route(2:ns);
steppair = steppair(2:ns+1);
nb = [fix(0.5*ns) fix(0.33*ns)];
if length(ns) < 4
nb = [1 2];
end
id = steppair(nb);
Dm = DM(steppair,steppair);
stepRout = diag(Dm,1)';
sortRout = sort(-stepRout);
sortRout = -sortRout;
if ch == 10
na = 1;
else
na = round(0.1*ns);
na = max([na 1]);
end
nt = round(sqrt(ns));
nt = ns-nt;
middleRout = mean(sortRout(na:nt));
m = sortRout(na:ns-1);
rc = m;
ra = rc.*m;
rb = sum(rc);
weightRout = sum(ra)/rb;
weightroute = sort(-route);
weightroute = -weightroute;
m = weightroute(na:ns-1);
rc = m;
ra = rc.*m;
rb = sum(rc);
weightroute = sum(ra)/rb;
if ch == 10
Rout = [0.5*(weightRout+middleRout) weightroute];
else
Rout = [0.5*(weightRout+middleRout) mean(m)];
end
|
|
Contact us at files@mathworks.com