Clustering data with the density-based method
As an alternative to distance measurement, we can use density-based measurement to cluster data. This method finds area with a higher density than the remaining area. One of the most famous methods is DBSCAN. In the following recipe, we demonstrate how to use DBSCAN to perform density-based clustering.
In this recipe, we will continue to use the hotel location dataset as the input data source to perform DBSCAN clustering.
How to do it…
Please perform the following steps to perform density-based clustering:
- First, install and load the
> install.packages("dbscan") > library(dbscan)
- Cluster data in regard to its density measurement:
> fit <- dbscan(hotel.dist, eps = 0.01, minPts ...