cutCalculation {uHMM} | R Documentation |
cutCalculation function
Description
Compute intra and inter-cluster cuts from the similarity matrix of a dataset.
Usage
cutCalculation(similarity, label, K)
Arguments
similarity |
a similarity matrix. |
label |
vector of cluster sequencing. |
K |
number of clusters. (= nbCluster CALCULE DANS LA FONCTION ???) |
Details
intra cluster cut :
Cut(g_{k},g_{l}) = \sum_{i=1,x(i)\in g_{k}}^{N_{p}}\sum_{j=1,x(j)\in g_{l}}^{N_{p}}w(x(i),x(j))
Value
The function returns a list containing:
mncut |
the inter-cluster cut, i.e. K-sum(ratioCutVol). |
ratioCutVol |
vector of intra-cluster cuts, one component per cluster. |
Examples
x<-rbind(matrix(runif(100),ncol=2),matrix(runif(100)+2,ncol=2),matrix(runif(20)*3,ncol=2))
similarity<-ZPGaussianSimilarity(x,7)%*%t(ZPGaussianSimilarity(x,7))
km<-kmeans(similarity,2)
label<-km$cluster
plot(x,col=km$cluster)
cutCalculation(similarity,label,length(unique(label)))
[Package uHMM version 1.0 Index]