How to do it...

Perform the following steps to visualize the dissimilarity matrix:

  1. First, install and load the seriation package:
        > install.packages("seriation")
        > library(seriation)
  1. You can then use dissplot to visualize the dissimilarity matrix in a heat map:
        > dissplot(dist(customer), labels=km$cluster,
options=list(main="Kmeans Clustering With k=4"))
A dissimilarity plot of k-means clustering
  1. Next, apply dissplot on hierarchical clustering in the heat map:
        > complete_c =  hclust(dist(customer), method="complete")
        > hc_complete =  cutree(complete_c, k = 4)
        > dissplot(dist(customer), labels=hc_complete,
options=list(main="Hierarchical Clustering"))
A dissimilarity plot of hierarchical clustering
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset