Clustering without using k-means

Now, Tableau can only do k-Means clustering. On the other hand, R can offer a variety of other clustering methodologies, such as hierarchical clustering.

In this topic, we will look at how R can do other types of clustering, which completes the picture of clustering in Tableau.

Hierarchical modeling

Hierarchical modeling is aimed at finding hierarchies of clusters. This facility is available to us in R. To do this, let's use the Iris dataset with an R script, which will focus on hierarchical clustering. The script is as follows:

IrisSample <- sample(1:dim(iris)[1],40)
IrisSample$Species <- NULL

dim(IrisSample)
hc <- hclust(dist(IrisSample), method="ave")
hc

plot(hc, hang = -1, labels=iris$Species[IrisSample])

In the following figure we can represent a cluster dendogram, which means the hierarchies of clusters.

Hierarchical modeling
..................Content has been hidden....................

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