# Compute Ward's minimum variance clustering
spe.ch.ward <- hclust(spe.ch, method = "ward.D2")
plot(spe.ch.ward,
main = "Chord - Ward")
Hint Below you will see more options of the plot() function which produces
dendrograms of objects of class hclust. Another path is to change the class of
such an object using function as.dendrogram(), which opens yet more
possibilities. Type ?dendrogram for details.
4.6 Flexible Clustering
Lance and Williams (1966, 1967) proposed a model encompassing all the clustering
methods described above, which are obtained by changing the values of four
parameters α h , α i , β and γ. See Legendre and Legendre (2012, p. 370). hclust()
is implemented using the Lance and Williams algorithm. As an alternative to the
examples above, flexible clustering is available in the R package cluster, function agnes(), using arguments method and par.method. In agnes(),
flexible clustering is called by argument method ¼ "flexible" and the parameters are given to the argument par.method as a numeric vector of length 1 (α h
only), 3 (α h , α i and β, with γ ¼ 0) or 4. In the simplest application of this rather
complex clustering method, flexibility is commanded by the value of parameter β,
hence the name “beta-flexible clustering”. Let us illustrate this by the computation of
a flexible clustering with β ¼ À0.25. If one provides only one value to par.
method, agnes() considers it as the value of α h in a context where
α h ¼ α i ¼ (1 À β)/2 and γ ¼ 0 (Legendre and Legendre 2012 p. 370). Therefore,
to obtain, as in the following example, β ¼ À0.25, the value to give is par.
method ¼ 0.625 because α h ¼ (1 À β)/2 ¼ (1 À (À0.25))/2 ¼ 0.625. See the
documentation file of agnes() for more details.
Beta-flexible clustering with beta ¼ À0.25 is computed as follows (Fig. 4.6):
# Compute beta-flexible clustering using cluster::agnes()
# beta = -0.25
spe.ch.beta2 <- agnes(spe.ch, method = "flexible",
par.method = 0.625)
# Change the class of agnes object
class(spe.ch.beta2)
# [1] "agnes" "twins"
spe.ch.beta2 <- as.hclust(spe.ch.beta2)
class(spe.ch.beta1)
# [1] "hclust"
plot(spe.ch.beta2,
labels = rownames(spe),
main = "Chord - Beta-flexible (beta=-0.25)")
4.6 Flexible Clustering
69
Précédent

- 82/444

Suivant