
Last chance! 50% off unlimited learning
Sale ends in
Determines the classifications corresponding to different numbers of groups given merge pairs from hierarchical agglomeration.
hclass(hcPairs, G)
A numeric two-column matrix in which the ith row gives the minimum index for observations in each of the two clusters merged at the ith stage of agglomerative hierarchical clustering.
An integer or vector of integers giving the number of clusters for which the corresponding classfications are wanted.
A matrix with length(G)
columns, each column
corresponding to a classification. Columns are indexed by the character
representation of the integers in G
.
C. Fraley, A. E. Raftery, T. B. Murphy and L. Scrucca (2012). mclust Version 4 for R: Normal Mixture Modeling for Model-Based Clustering, Classification, and Density Estimation. Technical Report No. 597, Department of Statistics, University of Washington.
# NOT RUN {
hcTree <- hc(modelName="VVV", data = iris[,-5])
cl <- hclass(hcTree,c(2,3))
# }
# NOT RUN {
par(pty = "s", mfrow = c(1,1))
clPairs(iris[,-5],cl=cl[,"2"])
clPairs(iris[,-5],cl=cl[,"3"])
# }
Run the code above in your browser using DataLab