# Create noise clustering with four clusters. Perform 30 starts
# from random seeds and keep the best solution
k <- 4
spe.nc <- vegclust(
spe.norm,
mobileCenters = k,
m = 1.5,
dnoise = 0.75,
method = "NC",
nstart = 30
)
spe.nc
# Medoids of species
(medoids <- spe.nc$mobileCenters)
# Fuzzy membership matrix
spe.nc$memb
# Cardinality of fuzzy clusters (i.e., the number of objects
# belonging to each cluster)
spe.nc$size
# Obtain hard membership vector, with 'N' for objects that are
# unclassified
spefuz.g <- defuzzify(spe.nc$memb)$cluster
clNum <- as.numeric(as.factor(spefuz.g))
# Ordination of fuzzy clusters (PCoA)
plot(dc.scores,
asp = 1,
type = "n")
abline(h = 0, lty = "dotted")
abline(v = 0, lty = "dotted")
for (i in 1:k)
{
gg <- dc.scores[clNum == i, ]
hpts <- chull(gg)
hpts <- c(hpts, hpts[1])
lines(gg[hpts, ], col = i + 1)
}
stars(
spe.nc$memb[, 1:4],
location = dc.scores,
key.loc = c(0.6, 0.4),
key.labels = 1:k,
draw.segments = TRUE,
add = TRUE,
len = 0.075,
col.segments = 2:(k + 1)
)
The hard partition contained in the clNum object is added to the ordination plot
(Fig. 4.39).
4.15 A Very Different Approach: Fuzzy Clustering
147
Précédent

- 160/444

Suivant