HCPC {FactoMineR} | R Documentation |
Performs an unsupervised hierarchical classification on results from a factor analysis. It is possible to cut the tree by clicking at the suggested (or an other) level. Results inlude paragons, description of the clusters, graphics.
HCPC(res, nb.clust=0, consol=TRUE, iter.max=10, min=3, max=NULL, metric="euclidean", method="ward", order=TRUE, graph.scale="inertia", nb.par=5, graph=TRUE, proba=0.05, ...)
res |
Either the result of a factor analysis, a dataframe, or a vector. |
nb.clust |
an integer. If 0, the tree is cut at the level the user clicks on. If -1, the tree is automatically cut at the suggested level (see details). If a (positive) integer, the tree is cut with nb.cluters clusters. |
consol |
a boolean. If TRUE, a k-means consolidation is performed. |
iter.max |
An integer. The maximum number of iterations for the consolidation. |
min |
an integer. The least possible number of clusters suggested. |
max |
an integer. The higher possible number of clusters suggested. |
metric |
The metric used to built the tree. See agnes for details. |
method |
The method used to built the tree. See agnes for details. |
order |
A boolean. If TRUE, clusters are ordered following their center coordinate on the first axis. |
graph.scale |
A character string. By default "inertia" and the height of the tree corresponds to the inertia gain, else "sqrt-inertia" the square root of the inertia gain. |
nb.par |
An integer. The number of edited paragons. |
graph |
If TRUE, graphics are displayed. If FALSE, no graph are displayed. |
proba |
The probability used to select axes and variables in
catdes (see catdes for details. |
... |
Other arguments from other methods. |
The function first built the tree with agnes. Then the sum of the intra-cluster inertia are calculated for each partition. The suggested partition is the one with the higher relative loss of inertia (i(clusters n+1)/i(cluster n)).
The absolut loss of inertia (i(cluster n)-i(cluster n+1)) is ploted with the tree.
Returns a list including:
data.clust |
The original data with a supplementary row called class containing the partition. |
desc.fact |
The description of the classes by factors (axes) or
variables (var). See catdes for details. |
call |
A list or parameters and internal objects. |
ind.desc |
The paragons (para) and the more typical individuals of each cluster. See details. |
Returns the tree and a barplot of the inertia gains, the individual
factor map with the tree (3D), the factor map with individuals colored
by cluster (2D).
Guillaume Le Ray, Quentin Molto, Francois Husson husson@agrocampus-ouest.fr
## Not run: data(iris) # Principal Component Analysis: res.pca <- PCA(iris[,1:4], ncp=10, graph=FALSE) # Clustering, auto nb of clusters: res.hcpc=HCPC(res.pca, nb.clust=-1) ## To choose an other partition on the tree: res.HCPC=HCPC(res.hcpc) ## End(Not run)