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 following GitHub link:
https://github.com/ywchiu/rcookbook/raw/master/chapter12/taipei_hotel.csv
How to do it…
Please perform the following steps to cluster location data into a hierarchy of clusters:
- First, load the data from
taipei_hotel.csv
...