Clustering data with hierarchical clustering

Hierarchical clustering adopts either an agglomerative or divisive method to build a hierarchy of clusters. Regardless of which approach is adopted, both initially use a distance similarity measure to combine clusters or split clusters. The recursive process continues until there is only one cluster left or one cannot split more clusters. Eventually, we can use a dendrogram to represent the hierarchy of clusters. In this recipe, we will demonstrate how to cluster hotel location data with hierarchical clustering.

Getting ready

In this recipe, we will perform hierarchical clustering on hotel location data to identify whether the hotels are located in the same district. You can download the data from the ...

Get R for Data Science Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.