1. The agglomerative clustering method that starts by placing
each observation into its own cluster, and then progressively
agglomerates each observation based on the desired linkage rule.
The complete-linkage approach agglomerates the observation or
sub-cluster in question to the sub-cluster having the shortest
distance to the most distant observation in
another sub-cluster.
Suppose that we have the following data (one variable). Use
complete linkage to identify the clusters. Data:
0 0 1 3 3 6 7 9 10 10
We will use R to solve this problem
Use following codes for complete linkage
data1=c(0,0,1,3,3,6,7,9,10,10)
dataframe<-data.frame(data1)
distmat<-dist(dataframe, method="euclidean",diag=FALSE, upper=FALSE)
clust<-hclust(distmat, method="complete")
Cluster<-cutree(clust,2)
table(Cluster)
Cluster Distribution | |
---|---|
Cluster | |
1 | 5 |
2 | 5 |
dataframe<-cbind(dataframe,Cluster)
agg<-aggregate(. ~ Cluster,data = dataframe, mean)
Cluster Means | |
---|---|
Cluster | data1 |
1 | 1.4 |
2 | 8.4 |
rect.hclust(clust,2)
plot(clust,label=,hang=-1)
#Dendogram
Get Answers For Free
Most questions answered within 1 hours.